Commit 65a1e66d authored by Jérome Perrin's avatar Jérome Perrin Committed by Arnaud Fontaine

tests: Fix Live Tests failures when ran several times.

parent 05971e68
......@@ -58,7 +58,9 @@ class TestIdToolUpgrade(ERP5TypeTestCase):
self.tic()
def beforeTearDown(self):
self.portal.portal_caches.clearAllCache()
self.id_tool.clearGenerator(all=True)
self.tic()
def createGenerators(self):
"""
......
......@@ -1683,6 +1683,10 @@ return True
document_object.getId())
response_a = self.publish(path)
action.setVisible(0)
def cleanup():
action.setVisible(1)
self.tic()
self.addCleanup(cleanup)
self.tic()
response_b = self.publish(path)
self.assertNotEqual(response_a.getBody(), response_b.getBody())
......
......@@ -584,8 +584,10 @@ class TestKM(TestKMMixIn):
gadget_view_form_id = km_latest_documents_gadget.view_form_id
publication_section_category_id_list = ['documentation', 'administration']
for category_id in publication_section_category_id_list:
portal.portal_categories.publication_section.newContent(portal_type = 'Category',
id = category_id)
if category_id not in portal.portal_categories.publication_section.objectIds():
portal.portal_categories.publication_section.newContent(
portal_type='Category',
id=category_id)
latest_docs_subsection = self.websection.newContent(portal_type='Web Section')
latest_docs_subsection.edit(membership_criterion_base_category = ['publication_section'],
membership_criterion_category=['publication_section/%s'
......
......@@ -86,6 +86,7 @@ class TestOOoImportMixin(ERP5TypeTestCase):
self.portal.portal_categories.gender,
self.portal.portal_categories.region,
]:
parent.setLastId('0')
parent.deleteContent(list(parent.objectIds()))
self.tic()
......
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