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):
time = status.get('time')
for action in action_list:
this_one = True
if time > action.get('time'):
if time <= action.get('time'):
# action in the past are not append
addable = False
for key in action.keys():
......
......@@ -880,7 +880,8 @@ class TestERP5DocumentSyncML(TestERP5DocumentSyncMLMixin):
#self.assertEquals(self.size_filename_text, document_c1.get_size())
document_s = document_server._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):
"""
......@@ -989,7 +990,9 @@ class TestERP5DocumentSyncML(TestERP5DocumentSyncMLMixin):
self.checkSynchronizationStateIsSynchronized()
document_s = document_server._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():
suite = unittest.TestSuite()
......
......@@ -375,7 +375,7 @@ class TestERP5SyncMLMixin(ERP5TypeTestCase):
self.tic()
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
"""
......@@ -401,7 +401,12 @@ class TestERP5SyncMLMixin(ERP5TypeTestCase):
# revision is based on workflow history, can not be checked
exclude_property_list = ('edit_workflow',)
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:
select = update.get('select', '')
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