Commit 784d1a0a authored by Arnaud Fontaine's avatar Arnaud Fontaine

Fix workflow history synchronization for ERP5SyncML.

Only the first workflow from the history was synchronized because of a
mistake when checking if the workflow can be added. Also, do not
ignore processing_status_workflow when running tests to detect such
problem in the future.
parent 97231f96
...@@ -894,7 +894,7 @@ class ERP5Conduit(XMLSyncUtilsMixin): ...@@ -894,7 +894,7 @@ class ERP5Conduit(XMLSyncUtilsMixin):
time = status.get('time') time = status.get('time')
for action in action_list: for action in action_list:
this_one = True this_one = True
if time > action.get('time'): if time <= action.get('time'):
# action in the past are not append # action in the past are not append
addable = False addable = False
for key in action.keys(): for key in action.keys():
......
...@@ -880,7 +880,8 @@ class TestERP5DocumentSyncML(TestERP5DocumentSyncMLMixin): ...@@ -880,7 +880,8 @@ class TestERP5DocumentSyncML(TestERP5DocumentSyncMLMixin):
#self.assertEquals(self.size_filename_text, document_c1.get_size()) #self.assertEquals(self.size_filename_text, document_c1.get_size())
document_s = document_server._getOb(self.id1) document_s = document_server._getOb(self.id1)
document_c = document_client1._getOb(self.id1) document_c = document_client1._getOb(self.id1)
self.assertXMLViewIsEqual(self.sub_id1, document_s, document_c1) self.assertXMLViewIsEqual(self.sub_id1, document_s, document_c1,
ignore_processing_status_workflow=True)
def test_10_BrokenMessage(self): def test_10_BrokenMessage(self):
""" """
...@@ -989,7 +990,9 @@ class TestERP5DocumentSyncML(TestERP5DocumentSyncMLMixin): ...@@ -989,7 +990,9 @@ class TestERP5DocumentSyncML(TestERP5DocumentSyncMLMixin):
self.checkSynchronizationStateIsSynchronized() self.checkSynchronizationStateIsSynchronized()
document_s = document_server._getOb(self.id1) document_s = document_server._getOb(self.id1)
document_c = document_client1._getOb(self.id1) document_c = document_client1._getOb(self.id1)
self.assertXMLViewIsEqual(self.sub_id1, document_s, document_c, force=1) # Ignore processing status workflow as
self.assertXMLViewIsEqual(self.sub_id1, document_s, document_c, force=True,
ignore_processing_status_workflow=True)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
...@@ -375,7 +375,7 @@ class TestERP5SyncMLMixin(ERP5TypeTestCase): ...@@ -375,7 +375,7 @@ class TestERP5SyncMLMixin(ERP5TypeTestCase):
self.tic() self.tic()
def assertXMLViewIsEqual(self, sub_id, object_pub=None, object_sub=None, def assertXMLViewIsEqual(self, sub_id, object_pub=None, object_sub=None,
force=False): force=False, ignore_processing_status_workflow=False):
""" """
Check the equality between two xml objects with gid as id Check the equality between two xml objects with gid as id
""" """
...@@ -401,7 +401,12 @@ class TestERP5SyncMLMixin(ERP5TypeTestCase): ...@@ -401,7 +401,12 @@ class TestERP5SyncMLMixin(ERP5TypeTestCase):
# revision is based on workflow history, can not be checked # revision is based on workflow history, can not be checked
exclude_property_list = ('edit_workflow',) exclude_property_list = ('edit_workflow',)
if object_pub.getPortalType() in self.portal.getPortalDocumentTypeList(): if object_pub.getPortalType() in self.portal.getPortalDocumentTypeList():
exclude_property_list += ('revision', 'processing_status_workflow',) exclude_property_list += ('revision',)
# XXX: perhaps the tag could be added (insert-after or remove
# for example) to check more precisely what property to ignore
# in either the source or destination
if ignore_processing_status_workflow:
exclude_property_list += ('processing_status_workflow',)
for update in result: for update in result:
select = update.get('select', '') select = update.get('select', '')
new_edit_workflow_entry_xpath = 'xupdate:element/xupdate:attribute'\ new_edit_workflow_entry_xpath = 'xupdate:element/xupdate:attribute'\
......
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