def test_changed_name_after_clean(self): c = Contact(**self.fields) c.full_clean() c.first_name = '' with self.assertRaises(ValidationError): c.full_clean() c.first_name = 'Baz' c.full_clean() c.save()
def test_bad_contact(self): self.fields.update({'email': ''}) c = Contact(**self.fields) with self.assertRaises(ValidationError): c.full_clean()
def test_new_contact(self): c = Contact(**self.fields) c.full_clean() c.save()