MCPcopy
hub / github.com/django/django / test_unique_together

Method test_unique_together

tests/model_inheritance/tests.py:677–685  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

675 grand_child.validate_unique()
676
677 def test_unique_together(self):
678 grand_child = GrandChild(
679 email="grand_child@example.com",
680 first_name=self.grand_parent.first_name,
681 last_name=self.grand_parent.last_name,
682 )
683 msg = "Grand parent with this First name and Last name already exists."
684 with self.assertRaisesMessage(ValidationError, msg):
685 grand_child.validate_unique()

Callers

nothing calls this directly

Calls 3

assertRaisesMessageMethod · 0.80
GrandChildClass · 0.70
validate_uniqueMethod · 0.45

Tested by

no test coverage detected