Commit 6ae4377a authored by Nicolas Delaby's avatar Nicolas Delaby

Conflict on base_data and data are now detected.

Update test


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35835 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3c271ebd
...@@ -910,10 +910,11 @@ class TestERP5DocumentSyncML(TestERP5DocumentSyncMLMixin): ...@@ -910,10 +910,11 @@ class TestERP5DocumentSyncML(TestERP5DocumentSyncMLMixin):
self.tic() self.tic()
self.synchronize(self.sub_id1) self.synchronize(self.sub_id1)
conflict_list = portal_sync.getConflictList() conflict_list = portal_sync.getConflictList()
self.assertEqual(len(conflict_list), 7) self.assertEqual(len(conflict_list), 9)
self.assertEqual(sorted([x.getKeyword() for x in conflict_list]), self.assertEqual(sorted([x.getKeyword() for x in conflict_list]),
['content_md5', 'content_type', 'description', ['base_data', 'content_md5', 'content_type',
'short_title', 'size', 'source_reference', 'title']) 'data', 'description', 'short_title', 'size',
'source_reference', 'title'])
# check if we have the state conflict on all clients # check if we have the state conflict on all clients
self.checkSynchronizationStateIsConflict() self.checkSynchronizationStateIsConflict()
# we will take : # we will take :
...@@ -922,16 +923,16 @@ class TestERP5DocumentSyncML(TestERP5DocumentSyncMLMixin): ...@@ -922,16 +923,16 @@ class TestERP5DocumentSyncML(TestERP5DocumentSyncMLMixin):
for conflict in conflict_list : for conflict in conflict_list :
subscriber = conflict.getSubscriber() subscriber = conflict.getSubscriber()
property = conflict.getPropertyId() property = conflict.getPropertyId()
resolve = 0 resolved = False
if property == 'description': if property == 'description':
if subscriber.getSubscriptionUrl()==self.publication_url: if subscriber.getSubscriptionUrl() == self.publication_url:
resolve = 1 resolved = True
conflict.applySubscriberValue() conflict.applySubscriberValue()
if property == 'short_title': if property == 'short_title':
if subscriber.getSubscriptionUrl()==self.subscription_url['two_way']: if subscriber.getSubscriptionUrl() == self.subscription_url['two_way']:
resolve = 1 resolved = True
conflict.applySubscriberValue() conflict.applySubscriberValue()
if not resolve: if not resolved:
conflict.applyPublisherValue() conflict.applyPublisherValue()
self.synchronize(self.sub_id1) self.synchronize(self.sub_id1)
self.checkSynchronizationStateIsSynchronized() self.checkSynchronizationStateIsSynchronized()
......
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