Ejemplo n.º 1
0
 def test_clean_password2_empty_password2(self):
     creation_form = UserCreationForm(
         data=self.get_form_data('*****@*****.**',
                                 username='******',
                                 password2=''))
     self.assertFalse(creation_form.is_valid())
     self.assertTrue('password2' in creation_form.errors)
Ejemplo n.º 2
0
 def test_clean_password2_different_passwords(self):
     creation_form = UserCreationForm(data=self.get_form_data(
         '*****@*****.**', username='******', password1='1234'))
     self.assertFalse(creation_form.is_valid())
     self.assertTrue('password2' in creation_form.errors)
     self.assertEqual(1, len(creation_form.errors))
     self.assertEqual(1, len(creation_form.errors))
Ejemplo n.º 3
0
 def test_clean_username_error(self):
     creation_form = UserCreationForm(
         data=self.get_form_data('*****@*****.**',
                                 username='******'))
     self.assertFalse(creation_form.is_valid())
     self.assertTrue('username' in creation_form.errors)
     self.assertEqual(1, len(creation_form.errors))
Ejemplo n.º 4
0
 def test_clean_password2_different_passwords(self):
     creation_form = UserCreationForm(
         data=self.get_form_data('*****@*****.**',
                                 username='******',
                                 password1='1234'))
     self.assertFalse(creation_form.is_valid())
     self.assertTrue('password2' in creation_form.errors)
     self.assertEqual(1, len(creation_form.errors))
     self.assertEqual(1, len(creation_form.errors))
Ejemplo n.º 5
0
 def create_form_data(self, email, username):
     form_data = {
         'email': email,
         'first_name': 'colabName',
         'last_name': 'secondName',
         'username': username,
         'password1': '123colab4',
         'password2': '123colab4'
     }
     form = UserCreationForm(data=form_data)
     return form
Ejemplo n.º 6
0
 def test_clean_password(self):
     creation_form = UserCreationForm(data=self.get_form_data(
         '*****@*****.**', username='******'))
     self.assertTrue(creation_form.is_valid())
Ejemplo n.º 7
0
 def test_clean_password2_empty_password2(self):
     creation_form = UserCreationForm(data=self.get_form_data(
         '*****@*****.**', username='******', password2=''))
     self.assertFalse(creation_form.is_valid())
     self.assertTrue('password2' in creation_form.errors)
Ejemplo n.º 8
0
 def test_clean_username_error(self):
     creation_form = UserCreationForm(data=self.get_form_data(
         '*****@*****.**', username='******'))
     self.assertFalse(creation_form.is_valid())
     self.assertTrue('username' in creation_form.errors)
     self.assertEqual(1, len(creation_form.errors))
Ejemplo n.º 9
0
 def test_clean_mail(self):
     creation_form = UserCreationForm(
         data=self.get_form_data('*****@*****.**'))
     self.assertTrue(creation_form.is_valid())
Ejemplo n.º 10
0
 def test_clean_mail_error(self):
     creation_form = UserCreationForm(
         data=self.get_form_data('*****@*****.**'))
     self.assertFalse(creation_form.is_valid())
     self.assertTrue('email' in creation_form.errors)
     self.assertEqual(1, len(creation_form.errors))
Ejemplo n.º 11
0
 def test_clean_password(self):
     creation_form = UserCreationForm(
         data=self.get_form_data('*****@*****.**',
                                 username='******'))
     self.assertTrue(creation_form.is_valid())
Ejemplo n.º 12
0
 def test_clean_mail(self):
     creation_form = UserCreationForm(
         data=self.get_form_data('*****@*****.**'))
     self.assertTrue(creation_form.is_valid())
Ejemplo n.º 13
0
 def test_clean_mail_error(self):
     creation_form = UserCreationForm(
         data=self.get_form_data('*****@*****.**'))
     self.assertFalse(creation_form.is_valid())
     self.assertTrue('email' in creation_form.errors)
     self.assertEqual(1, len(creation_form.errors))