Esempio n. 1
0
 def test_validate_success_register_form(self):
     # Ensure correct data validates.
     form = RegisterForm(
         email='*****@*****.**',
         password='******', confirm='example', last_name='example',
         name='example')
     self.assertTrue(form.validate())
Esempio n. 2
0
 def testEmailAlreadyRegistered(self):
     # Scenario with attempt to register using already registered email address
     form = RegisterForm(email='*****@*****.**',
                         username='******',
                         password='******',
                         confirm='admin_user')
     self.assertFalse(form.validate())
Esempio n. 3
0
 def testUserRegister(self):
     # Scenario with correct user data
     form = RegisterForm(email='*****@*****.**',
                         username='******',
                         password='******',
                         confirm='StrongPassword')
     self.assertTrue(form.validate())
Esempio n. 4
0
 def testUserRegisterShortPasswordLength(self):
     # Scenario with short password
     form = RegisterForm(email='*****@*****.**',
                         username='******',
                         password='******',
                         confirm='abc')
     self.assertFalse(form.validate())
Esempio n. 5
0
 def testUserRegisterPasswordDoesNotMatch(self):
     # Scenario with non-matching user password
     form = RegisterForm(email='*****@*****.**',
                         username='******',
                         password='******',
                         confirm='strongpassword')
     self.assertFalse(form.validate())
Esempio n. 6
0
 def test_validate_email_already_registered(self):
     # Ensure user can't register when a duplicate email is used
     form = RegisterForm(
         email='*****@*****.**',
         password='******',
         confirm='just_a_test_user'
     )
     self.assertFalse(form.validate())
Esempio n. 7
0
 def test_validate_email_already_registered(self):
     # Ensure user can't register when a duplicate email is used
     form = RegisterForm(
         email='*****@*****.**',
         password='******',
         confirm='admin_user'
     )
     self.assertFalse(form.validate())
Esempio n. 8
0
 def test_validate_email_already_registered(self):
     # Ensure user can't register when a duplicate email is used
     form = RegisterForm(
         email='*****@*****.**',
         password='******',
         confirm='admin_user',
         last_name='admin',
         name='admin'
     )
     self.assertFalse(form.validate())
Esempio n. 9
0
 def test_check_email_already_registered(self):
     """
     Tests that user can't register with a email that is already being used
     """
     form = RegisterForm(first_name='test',
                         last_name='test',
                         email='*****@*****.**',
                         password='******',
                         confirm='just_a_test_user')
     self.assertFalse(form.validate())
Esempio n. 10
0
 def test_check_invalid_password_format(self):
     """
     Test Check that incorrect data does not let a user register
     """
     form = RegisterForm(first_name='test',
                         last_name='test',
                         email='*****@*****.**',
                         password='******',
                         confirm='wrong')
     self.assertFalse(form.validate())
Esempio n. 11
0
 def test_check_success_register_form(self):
     """
     Test that correct data lets a user register
     """
     form = RegisterForm(email='*****@*****.**',
                         password='******',
                         first_name='test',
                         last_name='test',
                         confirm='example')
     self.assertTrue(form.validate())
Esempio n. 12
0
 def test_validate_invalid_password_format(self):
     # Ensure incorrect data does not validate.
     form = RegisterForm(
         email='*****@*****.**',
         password='******', confirm='')
     self.assertFalse(form.validate())
Esempio n. 13
0
 def test_validate_invalid_password_format(self):
     # Ensure incorrect data does not validate.
     form = RegisterForm(
         email='*****@*****.**',
         password='******', confirm='')
     self.assertFalse(form.validate())
Esempio n. 14
0
 def test_validate_success_register_form(self):
     # Ensure correct data validates.
     form = RegisterForm(
         email='*****@*****.**',
         password='******', confirm='example')
     self.assertTrue(form.validate())