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

Check email unicity of same parent type.

There might be many Email object with same email, but as they are subcontent
of other types, the unicity key shall be extended with parent type.
parent c6571aef
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</item> </item>
<item> <item>
<key> <string>filter_parameter</string> </key> <key> <string>filter_parameter</string> </key>
<value> <string>python: {\'portal_type\': object.getPortalType(), \'url_string\': object.getUrlString()}</string> </value> <value> <string>python: {\'portal_type\': object.getPortalType(), \'url_string\': object.getUrlString(), \'parent_portal_type\': object.getParentValue().getPortalType()}</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -162,6 +162,21 @@ class TestVifibEmailConstraint(testVifibMixin): ...@@ -162,6 +162,21 @@ class TestVifibEmailConstraint(testVifibMixin):
self.assertFalse(consistency_message in getMessageList(email)) self.assertFalse(consistency_message in getMessageList(email))
self.assertFalse(consistency_message in getMessageList(email_2)) self.assertFalse(consistency_message in getMessageList(email_2))
def test_url_string_does_not_conflict_with_credential(self):
url_string = rndstr()
person_email = self.portal.person_module.newContent(portal_type='Person'
).newContent(portal_type='Email', url_string=url_string)
credential_email = self.portal.credential_update_module.newContent(
portal_type='Credential Update').newContent(portal_type='Email',
url_string=url_string)
self.stepTic()
self.assertFalse('Email must be unique' in getMessageList(person_email))
self.assertFalse('Email must be unique' in getMessageList(credential_email))
class TestVifibInternalPackingListConstraint(testVifibMixin): class TestVifibInternalPackingListConstraint(testVifibMixin):
def getTitle(self): def getTitle(self):
return "Vifib Internal Packing List Constraint checks" return "Vifib Internal Packing List Constraint checks"
......
204 205
\ 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