Beispiel #1
0
 def test_non_mandatory_names(self):
     """ Check that non required parameters are not checked by is_valid
     method."""
     data = {
         'username':'******',
         'email':'*****@*****.**',
         'password':'******',
         'password_check':'passwd'
     }
     form = UserForm(data)
     self.assertTrue(form.is_valid())
Beispiel #2
0
 def test_valid_form(self):
     """" This method checks that the overriden method is_valid works."""
     data = {
         'username':'******',
         'last_name':'bar',
         'first_name':'baz',
         'email':'*****@*****.**',
         'password':'******',
         'password_check':'passwd'
     }
     form = UserForm(data)
     self.assertTrue(form.is_valid())
Beispiel #3
0
 def test_password_check(self):
     """ This methods checks that the 2 occurences of entered password are
     compared."""
     data = {
         'username':'******',
         'last_name':'bar',
         'first_name':'baz',
         'email':'*****@*****.**',
         'password':'******',
         'password_check':'toto'
     }
     form = UserForm(data)
     self.assertFalse(form.is_valid())