def test_cannot_change_person_to_unnamed(self): person = PersonFactory() with self.assertRaises(ValidationError): person.name = "" person.full_clean()
def test_cannot_create_person_with_no_name(self): with self.assertRaises(ValidationError): person = PersonFactory(name="") person.full_clean()