Commit 78b6bb2b authored by Nicolas Delaby's avatar Nicolas Delaby

update One way test (use alert code explicitely)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15501 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 48b3a1ba
...@@ -1326,19 +1326,21 @@ class TestERP5SyncML(TestERP5SyncMLMixin, ERP5TypeTestCase): ...@@ -1326,19 +1326,21 @@ class TestERP5SyncML(TestERP5SyncMLMixin, ERP5TypeTestCase):
LOG('Testing... ',0,'test_32_AddOneWaySubscription') LOG('Testing... ',0,'test_32_AddOneWaySubscription')
portal_id = self.getPortalId() portal_id = self.getPortalId()
portal_sync = self.getSynchronizationTool() portal_sync = self.getSynchronizationTool()
portal_sync.manage_addSubscription(title=self.sub_id1, portal_sync.manage_addSubscription(title=self.sub_id1,
publication_url=self.publication_url, publication_url=self.publication_url,
subscription_url=self.subscription_url1, subscription_url=self.subscription_url1,
destination_path='/%s/person_client1' % portal_id, destination_path='/%s/person_client1' % portal_id,
source_uri='Person', source_uri='Person',
target_uri='Person', target_uri='Person',
query='objectValues', query='objectValues',
xml_mapping='', xml_mapping=self.xml_mapping,
conduit='ERP5Conduit', conduit='ERP5Conduit',
gpg_key='', gpg_key='',
gid_generator='getId', gid_generator='getId',
activity_enabled=False) activity_enabled=False,
alert_code = SyncCode.ONE_WAY_FROM_SERVER)
sub = portal_sync.getSubscription(self.sub_id1) sub = portal_sync.getSubscription(self.sub_id1)
self.assertTrue(sub.isOneWayFromServer())
self.failUnless(sub is not None) self.failUnless(sub is not None)
def test_33_OneWaySync(self, quiet=0, run=run_all_test): def test_33_OneWaySync(self, quiet=0, run=run_all_test):
...@@ -1357,11 +1359,11 @@ class TestERP5SyncML(TestERP5SyncMLMixin, ERP5TypeTestCase): ...@@ -1357,11 +1359,11 @@ class TestERP5SyncML(TestERP5SyncMLMixin, ERP5TypeTestCase):
nb_person = self.populatePersonServer(quiet=1,run=1) nb_person = self.populatePersonServer(quiet=1,run=1)
portal_sync = self.getSynchronizationTool() portal_sync = self.getSynchronizationTool()
for sub in portal_sync.getSubscriptionList(): for sub in portal_sync.getSubscriptionList():
self.assertEquals(sub.getSynchronizationType(),SyncCode.SLOW_SYNC) self.assertEquals(sub.getSynchronizationType(), SyncCode.SLOW_SYNC)
# First do the sync from the server to the client # First do the sync from the server to the client
nb_message1 = self.synchronize(self.sub_id1) nb_message1 = self.synchronize(self.sub_id1)
for sub in portal_sync.getSubscriptionList(): for sub in portal_sync.getSubscriptionList():
self.assertEquals(sub.getSynchronizationType(),SyncCode.TWO_WAY) self.assertEquals(sub.getSynchronizationType(), SyncCode.ONE_WAY_FROM_SERVER)
self.assertEquals(nb_message1,self.nb_message_first_synchronization) self.assertEquals(nb_message1,self.nb_message_first_synchronization)
subscription1 = portal_sync.getSubscription(self.sub_id1) subscription1 = portal_sync.getSubscription(self.sub_id1)
self.assertEquals(len(subscription1.getObjectList()),nb_person) self.assertEquals(len(subscription1.getObjectList()),nb_person)
...@@ -1384,7 +1386,6 @@ class TestERP5SyncML(TestERP5SyncMLMixin, ERP5TypeTestCase): ...@@ -1384,7 +1386,6 @@ class TestERP5SyncML(TestERP5SyncMLMixin, ERP5TypeTestCase):
self.assertEquals(person1_c.getLastName(),self.last_name2) self.assertEquals(person1_c.getLastName(),self.last_name2)
self.assertEquals(person1_s.getFirstName(),self.first_name1) self.assertEquals(person1_s.getFirstName(),self.first_name1)
def test_34_encoding(self, quiet=0, run=run_all_test): def test_34_encoding(self, quiet=0, run=run_all_test):
""" """
We will test if we can encode strings with b64encode to encode We will test if we can encode strings with b64encode to encode
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment