コード例 #1
0
ファイル: test_models.py プロジェクト: iDemandLiberty/site
 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
ファイル: test_models.py プロジェクト: iDemandLiberty/site
 def test_bad_contact(self):
     self.fields.update({'email': ''})
     c = Contact(**self.fields)
     with self.assertRaises(ValidationError):
         c.full_clean()
コード例 #3
0
ファイル: test_models.py プロジェクト: iDemandLiberty/site
 def test_new_contact(self):
     c = Contact(**self.fields)
     c.full_clean()
     c.save()