Commit dcbf5b36 authored by Łukasz Nowak's avatar Łukasz Nowak

Allow to avoid empty_string constraints.

This is workaround for some bugs in setters, which are irrelevant for testing.
parent cab7508a
...@@ -14,7 +14,7 @@ class TestSlapOSConstraintMixin(testSlapOSMixin): ...@@ -14,7 +14,7 @@ class TestSlapOSConstraintMixin(testSlapOSMixin):
return [str(q.getMessage()) for q in o.checkConsistency()] return [str(q.getMessage()) for q in o.checkConsistency()]
def _test_property_existence(self, obj, property_id, consistency_message, def _test_property_existence(self, obj, property_id, consistency_message,
value='A'): value='A', empty_string=True):
obj.edit(**{property_id:value}) obj.edit(**{property_id:value})
# fetch basic list of consistency messages # fetch basic list of consistency messages
...@@ -28,8 +28,9 @@ class TestSlapOSConstraintMixin(testSlapOSMixin): ...@@ -28,8 +28,9 @@ class TestSlapOSConstraintMixin(testSlapOSMixin):
delattr(obj, property_id) delattr(obj, property_id)
self.assertTrue(consistency_message in self.getMessageList(obj)) self.assertTrue(consistency_message in self.getMessageList(obj))
obj.edit(**{property_id:''}) if empty_string:
self.assertTrue(consistency_message in self.getMessageList(obj)) obj.edit(**{property_id:''})
self.assertTrue(consistency_message in self.getMessageList(obj))
obj.edit(**{property_id:value}) obj.edit(**{property_id:value})
self.assertFalse(consistency_message in self.getMessageList(obj)) self.assertFalse(consistency_message in self.getMessageList(obj))
......
240 241
\ No newline at end of file \ No newline at end of file
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