Commit 443b84de authored by Nicolas Delaby's avatar Nicolas Delaby

Wrap test arround try finally to restore SyncCode.MAX_LINES value

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35838 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f54b95eb
......@@ -1341,28 +1341,30 @@ class TestERP5SyncML(TestERP5SyncMLMixin, ERP5TypeTestCase):
ZopeTestCase._print('\nTest Partial Data ')
LOG('Testing... ',0,'test_28_PartialData')
previous_max_lines = SyncCode.MAX_LINES
SyncCode.MAX_LINES = 10
self.populatePersonServerWithSubObject(quiet=1,run=1)
self.synchronize(self.sub_id1)
self.synchronize(self.sub_id2)
self.checkSynchronizationStateIsSynchronized()
person_client1 = self.getPersonClient1()
person1_c = person_client1._getOb(self.id1)
sub_person1_c = person1_c._getOb(self.id1)
sub_sub_person1 = sub_person1_c._getOb(self.id1)
sub_sub_person2 = sub_person1_c._getOb(self.id2)
# remove ('','portal...','person_server')
len_path = len(sub_sub_person1.getPhysicalPath()) - 3
self.assertEqual(len_path, 3)
len_path = len(sub_sub_person2.getPhysicalPath()) - 3
self.assertEqual(len_path, 3)
self.assertEquals(sub_sub_person1.getDescription(),self.description1)
self.assertEquals(sub_sub_person1.getFirstName(),self.first_name1)
self.assertEquals(sub_sub_person1.getLastName(),self.last_name1)
self.assertEquals(sub_sub_person2.getDescription(),self.description2)
self.assertEquals(sub_sub_person2.getFirstName(),self.first_name2)
self.assertEquals(sub_sub_person2.getLastName(),self.last_name2)
SyncCode.MAX_LINES = previous_max_lines
try:
SyncCode.MAX_LINES = 10
self.populatePersonServerWithSubObject(quiet=1,run=1)
self.synchronize(self.sub_id1)
self.synchronize(self.sub_id2)
self.checkSynchronizationStateIsSynchronized()
person_client1 = self.getPersonClient1()
person1_c = person_client1._getOb(self.id1)
sub_person1_c = person1_c._getOb(self.id1)
sub_sub_person1 = sub_person1_c._getOb(self.id1)
sub_sub_person2 = sub_person1_c._getOb(self.id2)
# remove ('','portal...','person_server')
len_path = len(sub_sub_person1.getPhysicalPath()) - 3
self.assertEqual(len_path, 3)
len_path = len(sub_sub_person2.getPhysicalPath()) - 3
self.assertEqual(len_path, 3)
self.assertEquals(sub_sub_person1.getDescription(),self.description1)
self.assertEquals(sub_sub_person1.getFirstName(),self.first_name1)
self.assertEquals(sub_sub_person1.getLastName(),self.last_name1)
self.assertEquals(sub_sub_person2.getDescription(),self.description2)
self.assertEquals(sub_sub_person2.getFirstName(),self.first_name2)
self.assertEquals(sub_sub_person2.getLastName(),self.last_name2)
finally:
SyncCode.MAX_LINES = previous_max_lines
def test_29_BrokenMessage(self, quiet=0, run=run_all_test):
"""
......
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