Commit eb7e41b1 authored by Jérome Perrin's avatar Jérome Perrin

testCMFActivity: do not rely on unittest internals (_resultForDoCleanups)

_resultForDoCleanups no longer exists on python3, getting the status
of a test in teardown is very different accross python versions ( see
https://stackoverflow.com/q/4414234 ) and just executing this code when
the test failed only has the problem that a test method may count as
two failures or errors, which is after all not a big problem.
parent b5c0a0dc
...@@ -138,12 +138,11 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor): ...@@ -138,12 +138,11 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
# activity messages. We are testing CMFActivity so it's important to check # activity messages. We are testing CMFActivity so it's important to check
# that everything works as expected on this subject. # that everything works as expected on this subject.
try: try:
if self._resultForDoCleanups.wasSuccessful(): getMessageList = self.portal.portal_activities.getMessageList
getMessageList = self.portal.portal_activities.getMessageList self.assertFalse(getMessageList())
self.assertFalse(getMessageList()) # Also check if a test drop them without committing.
# Also check if a test drop them without committing. self.abort()
self.abort() self.assertFalse(getMessageList())
self.assertFalse(getMessageList())
finally: finally:
ERP5TypeTestCase.tearDown(self) ERP5TypeTestCase.tearDown(self)
......
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