From 35b49e94c8544a3b3f5d9fbba9ec9638ecf55aaf Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Tue, 22 Jun 2010 14:21:52 +0000
Subject: [PATCH] Test covers both synchronous & asynchronous ways.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36513 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5OOo/tests/testDms.py | 33 ++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)

diff --git a/product/ERP5OOo/tests/testDms.py b/product/ERP5OOo/tests/testDms.py
index 6a0abe2eba..51daaf07c9 100644
--- a/product/ERP5OOo/tests/testDms.py
+++ b/product/ERP5OOo/tests/testDms.py
@@ -1812,19 +1812,36 @@ return 1
     """
     portal = self.portal
     kw = {'url':portal.absolute_url()}
-    web_page = portal.Base_contribute(**kw)
+    web_page_1 = portal.Base_contribute(**kw)
     self.stepTic()
-    self.assertTrue(web_page.getRevision()=='2')
+    self.assertTrue(web_page_1.getRevision()=='2')
     
-    second_web_page = portal.Base_contribute(**kw)
+    web_page_2 = portal.Base_contribute(**kw)
     self.stepTic()
-    self.assertTrue(web_page==second_web_page)
-    self.assertTrue(second_web_page.getRevision()=='3')
+    self.assertTrue(web_page_1==web_page_2)
+    self.assertTrue(web_page_2.getRevision()=='3')
 
-    third_web_page = portal.Base_contribute(**kw)
+    web_page_3 = portal.Base_contribute(**kw)
     self.stepTic()
-    self.assertTrue(web_page==second_web_page==third_web_page)
-    self.assertTrue(third_web_page.getRevision()=='4')
+    self.assertTrue(web_page_2==web_page_3)
+    self.assertTrue(web_page_3.getRevision()=='4')
+
+    # test in synchronous mode
+    kw['synchronous_metadata_discovery']=True
+    web_page_4 = portal.Base_contribute(**kw)
+    self.stepTic()
+    self.assertTrue(web_page_3==web_page_4)
+    self.assertTrue(web_page_4.getRevision()=='5')
+
+    web_page_5 = portal.Base_contribute(**kw)
+    self.stepTic()
+    self.assertTrue(web_page_4==web_page_5)
+    self.assertTrue(web_page_5.getRevision()=='6')
+
+    web_page_6 = portal.Base_contribute(**kw)
+    self.stepTic()
+    self.assertTrue(web_page_5==web_page_6)
+    self.assertTrue(web_page_6.getRevision()=='7')
     
 
 class TestDocumentWithSecurity(TestDocumentMixin):
-- 
2.30.9