Пример #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()
Пример #2
0
 def test_bad_contact(self):
     self.fields.update({'email': ''})
     c = Contact(**self.fields)
     with self.assertRaises(ValidationError):
         c.full_clean()
Пример #3
0
 def test_new_contact(self):
     c = Contact(**self.fields)
     c.full_clean()
     c.save()