def test_inactive_user_login(self): user = User.objects.create_user('*****@*****.**', 'secret') user.is_active = False user.save() form = AuthenticationForm(data={'email': '*****@*****.**', 'password': '******'}) self.assertFalse(form.is_valid()) self.assertEqual([u"To konto jest niekatywne."], form.errors['__all__'])
def test_inactive_user_login(self): user = User.objects.create_user('*****@*****.**', 'secret') user.is_active = False user.save() form = AuthenticationForm(data={ 'email': '*****@*****.**', 'password': '******' }) self.assertFalse(form.is_valid()) self.assertEqual([u"To konto jest niekatywne."], form.errors['__all__'])
def test_successful_login(self): User.objects.create_user('*****@*****.**', 'secret') form = AuthenticationForm(data={'email': '*****@*****.**', 'password': '******'}) self.assertTrue(form.is_valid()) # I don't know at this moment how to test form with reCaptcha field # class ClaimFormTest(TestCase): # def test_non_existing_person(self): # error_message = [u"Osoba o podanym imieniu i nazwisku nie istnieje w naszej bazie."] # form = ClaimForm(data={})
def test_successful_login(self): User.objects.create_user('*****@*****.**', 'secret') form = AuthenticationForm(data={ 'email': '*****@*****.**', 'password': '******' }) self.assertTrue(form.is_valid()) # I don't know at this moment how to test form with reCaptcha field # class ClaimFormTest(TestCase): # def test_non_existing_person(self): # error_message = [u"Osoba o podanym imieniu i nazwisku nie istnieje w naszej bazie."] # form = ClaimForm(data={})
def test_incorrect_login(self): form = AuthenticationForm(data={'email': '*****@*****.**', 'password': '******'}) self.assertFalse(form.is_valid())
def test_incorrect_login(self): form = AuthenticationForm(data={ 'email': '*****@*****.**', 'password': '******' }) self.assertFalse(form.is_valid())