コード例 #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())
コード例 #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')
コード例 #3
0
ファイル: test_forms.py プロジェクト: promigo1/ua-mama-cas
 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())
コード例 #4
0
ファイル: test_forms.py プロジェクト: promigo1/ua-mama-cas
 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')