Commit 35b49e94 authored by Ivan Tyagov's avatar Ivan Tyagov

Test covers both synchronous & asynchronous ways.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36513 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8c5c27a9
...@@ -1812,19 +1812,36 @@ return 1 ...@@ -1812,19 +1812,36 @@ return 1
""" """
portal = self.portal portal = self.portal
kw = {'url':portal.absolute_url()} kw = {'url':portal.absolute_url()}
web_page = portal.Base_contribute(**kw) web_page_1 = portal.Base_contribute(**kw)
self.stepTic() 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.stepTic()
self.assertTrue(web_page==second_web_page) self.assertTrue(web_page_1==web_page_2)
self.assertTrue(second_web_page.getRevision()=='3') self.assertTrue(web_page_2.getRevision()=='3')
third_web_page = portal.Base_contribute(**kw) web_page_3 = portal.Base_contribute(**kw)
self.stepTic() self.stepTic()
self.assertTrue(web_page==second_web_page==third_web_page) self.assertTrue(web_page_2==web_page_3)
self.assertTrue(third_web_page.getRevision()=='4') 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): class TestDocumentWithSecurity(TestDocumentMixin):
......
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