Commit 81a6bf4b authored by Julien Muchembled's avatar Julien Muchembled

Delete failed activities in beforeTearDown so that following tests work

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30911 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f7024258
...@@ -141,17 +141,22 @@ class TestDocument(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -141,17 +141,22 @@ class TestDocument(ERP5TypeTestCase, ZopeTestCase.Functional):
Do some stuff after each test: Do some stuff after each test:
- clear document module - clear document module
""" """
transaction.abort()
activity_tool = self.portal.portal_activities
activity_status = set(m.processing_node < -1
for m in activity_tool.getMessageList())
if True in activity_status:
activity_tool.manageClearActivities()
else:
assert not activity_status
self.clearDocumentModule() self.clearDocumentModule()
def clearDocumentModule(self): def clearDocumentModule(self):
""" """
Remove everything after each run Remove everything after each run
""" """
transaction.abort()
self.tic()
doc_module = self.getDocumentModule() doc_module = self.getDocumentModule()
ids = [i for i in doc_module.objectIds()] doc_module.manage_delObjects(list(doc_module.objectIds()))
doc_module.manage_delObjects(ids)
transaction.commit() transaction.commit()
self.tic() self.tic()
...@@ -582,6 +587,7 @@ class TestDocument(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -582,6 +587,7 @@ class TestDocument(ERP5TypeTestCase, ZopeTestCase.Functional):
response.headers['content-type']) response.headers['content-type'])
self.assertEquals('attachment; filename="import_data_list.ods"', self.assertEquals('attachment; filename="import_data_list.ods"',
response.headers['content-disposition']) response.headers['content-disposition'])
self.tic()
def test_Member_download_pdf_format(self): def test_Member_download_pdf_format(self):
# tests that members can download OOo documents in pdf format (at least in # tests that members can download OOo documents in pdf format (at least in
......
...@@ -113,6 +113,13 @@ class TestIngestion(ERP5TypeTestCase): ...@@ -113,6 +113,13 @@ class TestIngestion(ERP5TypeTestCase):
self.setTools() self.setTools()
def beforeTearDown(self): def beforeTearDown(self):
activity_tool = self.portal.portal_activities
activity_status = set(m.processing_node < -1
for m in activity_tool.getMessageList())
if True in activity_status:
activity_tool.manageClearActivities()
else:
assert not activity_status
self.portal.portal_caches.clearAllCache() self.portal.portal_caches.clearAllCache()
def setSystemPreference(self): def setSystemPreference(self):
...@@ -1197,6 +1204,7 @@ class TestIngestion(ERP5TypeTestCase): ...@@ -1197,6 +1204,7 @@ class TestIngestion(ERP5TypeTestCase):
step_list = [ 'stepCleanUp' step_list = [ 'stepCleanUp'
,'stepCreatePDFDocument' ,'stepCreatePDFDocument'
,'stepExportPDF' ,'stepExportPDF'
,'stepTic'
] ]
self.playSequence(step_list, quiet) self.playSequence(step_list, quiet)
...@@ -1231,6 +1239,7 @@ class TestIngestion(ERP5TypeTestCase): ...@@ -1231,6 +1239,7 @@ class TestIngestion(ERP5TypeTestCase):
,'stepDeleteSnapshot' ,'stepDeleteSnapshot'
,'stepCheckHasNoSnapshot' ,'stepCheckHasNoSnapshot'
,'stepCreateSnapshot' ,'stepCreateSnapshot'
,'stepTic'
] ]
self.playSequence(step_list, quiet) self.playSequence(step_list, quiet)
......
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