Ejemplo n.º 1
0
 def test_registration_form_with_tos_checkbox_validates(self):
     data = {
         'email': '*****@*****.**',
         'password1': 'Pa$sw0rd',
         'password2': 'Pa$sw0rd',
         'tos': True
     }
     form = RegistrationFormTermsOfService(data=data)
     self.assertTrue(form.is_valid())
Ejemplo n.º 2
0
 def test_registration_form_with_tos_checkbox_validates(self):
     data = {
         'email': '*****@*****.**',
         'password1': 'Pa$sw0rd',
         'password2': 'Pa$sw0rd',
         'tos': True
     }
     form = RegistrationFormTermsOfService(data=data)
     self.assertTrue(form.is_valid())
Ejemplo n.º 3
0
 def test_registration_form_with_tos_checkbox_fails(self):
     data = {
         'email': '*****@*****.**',
         'password1': 'Pa$sw0rd',
         'password2': 'Pa$sw0rd',
     }
     form = RegistrationFormTermsOfService(data=data)
     self.assertFalse(form.is_valid())
     self.assertEqual(form.errors['tos'], [u'You must agree to the terms to register'])
Ejemplo n.º 4
0
 def test_registration_form_with_tos_checkbox_fails(self):
     data = {
         'email': '*****@*****.**',
         'password1': 'Pa$sw0rd',
         'password2': 'Pa$sw0rd',
     }
     form = RegistrationFormTermsOfService(data=data)
     self.assertFalse(form.is_valid())
     self.assertEqual(form.errors['tos'],
                      [u'You must agree to the terms to register'])