Commit 2bc75bf6 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Add assertHasAttribute and failIfHasAttribute to ERP5TypeTestCase.

parent 984f4616
......@@ -522,6 +522,16 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
self.assertEquals(set(a), set(b), msg)
assertSameSet = failIfDifferentSet
def assertHasAttribute(self, obj, attribute, msg=None):
self.failIfEqual(None, getattr(obj, attribute, None),
msg or '%s: no attribute %s' % (obj.__name__,
attribute))
def failIfHasAttribute(self, obj, attribute, msg=None):
self.assertEquals(None, getattr(obj, attribute, None),
msg or '%s: attribute %s present' % (obj.__name__,
attribute))
def assertWorkflowTransitionFails(self, object, workflow_id, transition_id,
error_message=None, state_variable='simulation_state'):
"""
......
......@@ -616,16 +616,6 @@ class TestZodbPropertySheet(ERP5TypeTestCase):
transaction.commit()
self.test_module.getId()
def assertHasAttribute(self, obj, attribute, msg=None):
self.failIfEqual(None, getattr(obj, attribute, None),
msg or '%s: no attribute %s' % (obj.__name__,
attribute))
def failIfHasAttribute(self, obj, attribute, msg=None):
self.assertEquals(None, getattr(obj, attribute, None),
msg or '%s: attribute %s present' % (obj.__name__,
attribute))
def testAssignUnassignZodbPropertySheet(self):
"""
From an existing portal type, assign ZODB Property Sheets and
......
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