Exemplo n.º 1
0
 def test_clean_email_new_user(self):
     form = CoffeestatsRegistrationForm(
         data={'username': '******',
               'email': '*****@*****.**',
               'password1': 'test1234',
               'password2': 'test1234'}
     )
     self.assertTrue(form.is_valid(), str(form.errors))
 def test_clean_email_new_user(self):
     form = CoffeestatsRegistrationForm(
         data={
             'username': '******',
             'email': '*****@*****.**',
             'password1': 'test1234',
             'password2': 'test1234'
         })
     self.assertTrue(form.is_valid(), str(form.errors))
Exemplo n.º 3
0
 def test_clean_email_existing_email(self):
     User.objects.create_user('testuser', '*****@*****.**')
     form = CoffeestatsRegistrationForm(
         data={'username': '******',
               'email': '*****@*****.**',
               'password1': 'test1234',
               'password2': 'test1234'}
     )
     self.assertFalse(form.is_valid())
     self.assertEqual(form.errors['email'], [DUPLICATE_EMAIL_ERROR])
 def test_clean_email_existing_email(self):
     User.objects.create_user('testuser', '*****@*****.**')
     form = CoffeestatsRegistrationForm(
         data={
             'username': '******',
             'email': '*****@*****.**',
             'password1': 'test1234',
             'password2': 'test1234'
         })
     self.assertFalse(form.is_valid())
     self.assertEqual(form.errors['email'], [DUPLICATE_EMAIL_ERROR])