If I have a model called Enquiry
with an attribute of email
how might I check that creating an Enquiry with an invalid email raises an error?
I have tried this
def test_email_is_valid(self):
self.assertRaises(ValidationError, Enquiry.objects.create(email="testtest.com"))
However I get the Error
TypeError: 'Enquiry' object is not callable
I'm not quite getting something, does anybody know the correct method to test for email validation?