Exemplo n.º 1
0
 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()
Exemplo n.º 2
0
 def test_bad_contact(self):
     self.fields.update({'email': ''})
     c = Contact(**self.fields)
     with self.assertRaises(ValidationError):
         c.full_clean()
Exemplo n.º 3
0
 def test_new_contact(self):
     c = Contact(**self.fields)
     c.full_clean()
     c.save()