예제 #1
0
 def test_add_user_wrong_email(self):
     with self.assertRaises(Exception):
         user = User(username='******',
                     email='testuser_at_somemail.com',
                     password='******')
         user.full_clean()
예제 #2
0
 def test_cant_create_duplicate(self):
     User.objects.create_user(username='******', password='******')
     with self.assertRaises(ValidationError):
         user = User(username='******', password='******')
         user.full_clean()
예제 #3
0
 def test_add_user_with_all_fields(self):
     user = User(username='******',
                 email='*****@*****.**',
                 password='******')
     user.full_clean()
     user.save()