Commit b61f7f62 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 255ea5f2
......@@ -139,12 +139,11 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
# activity messages. We are testing CMFActivity so it's important to check
# that everything works as expected on this subject.
try:
if self._resultForDoCleanups.wasSuccessful():
getMessageList = self.portal.portal_activities.getMessageList
self.assertFalse(getMessageList())
# Also check if a test drop them without committing.
self.abort()
self.assertFalse(getMessageList())
getMessageList = self.portal.portal_activities.getMessageList
self.assertFalse(getMessageList())
# Also check if a test drop them without committing.
self.abort()
self.assertFalse(getMessageList())
finally:
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