Пример #1
0
 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__'])
Пример #2
0
 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__'])
Пример #3
0
    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={})
Пример #4
0
    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={})
Пример #5
0
 def test_incorrect_login(self):
     form = AuthenticationForm(data={'email': '*****@*****.**',
                                     'password': '******'})
     self.assertFalse(form.is_valid())
Пример #6
0
 def test_incorrect_login(self):
     form = AuthenticationForm(data={
         'email': '*****@*****.**',
         'password': '******'
     })
     self.assertFalse(form.is_valid())