Exemple #1
0
 def test_login_form_invalid_username_clean(self):
     """
     If an username is provided such that it becomes invalid when
     cleaned, the form should be invalid.
     """
     form = LoginFormEmail(data={
         'username': '******',
         'password': '******'
     })
     self.assertFalse(form.is_valid())
Exemple #2
0
 def test_login_form_email(self):
     """
     If an email address is provided, the username portion should be
     extracted and returned as the username.
     """
     form = LoginFormEmail(data={
         'username': '******',
         'password': '******'
     })
     self.assertTrue(form.is_valid())
     self.assertEqual(form.cleaned_data['username'], 'ellen')