예제 #1
0
 def test_not_saving_without_email(self):
     '''Test that model cannot be validated without an email'''
     bio = Bio(
         name='Bob',
         last_name='Green',
         birth_date='1989-04-13',
         bio="I'm Bob!\nHello",
         )
     with self.assertRaises(ValidationError):
         bio.full_clean()
예제 #2
0
 def test_not_saving_without_bio(self):
     '''Test that model cannot be validated without a biography'''
     bio = Bio(
         name='Bob',
         last_name='Green',
         birth_date='1989-04-13',
         email='*****@*****.**'
         )
     with self.assertRaises(ValidationError):
         bio.full_clean()
예제 #3
0
 def test_not_saving_without_birth_date(self):
     '''Test that model cannot be validated without the date of birth'''
     bio = Bio(
         name='Bob',
         last_name='Green',
         bio="I'm Bob!\nHello",
         email='*****@*****.**'
         )
     with self.assertRaises(ValidationError):
         bio.full_clean()
예제 #4
0
 def test_not_saving_without_last_name(self):
     '''Test that model cannot be validated without a last name'''
     bio = Bio(
         name='Bob',
         birth_date='1989-04-13',
         bio="I'm Bob!\nHello",
         email='*****@*****.**'
         )
     with self.assertRaises(ValidationError):
         bio.full_clean()