From 70638b01a2ed51f8dac8fe627acc097b1a606f65 Mon Sep 17 00:00:00 2001 From: Ves Nikos Date: Sat, 10 Sep 2016 13:08:31 +0100 Subject: [PATCH] forgot to follow the redirect at landing page --- app/tests.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/tests.py b/app/tests.py index 2ca54244..39be5fb3 100644 --- a/app/tests.py +++ b/app/tests.py @@ -28,20 +28,18 @@ class TestUser(TestCase): def test_User_Login_Test(self): c = Client() # User points the browser to the landing page - res = c.get('/') + res = c.post('/', follow=True) # the user is not logged in self.assertFalse(res.context['user'].is_authenticated) # and is redirected to the login page self.assertRedirects(res, '/login/') - # The login page - res = c.get('/login/') - # is being rendered by the correct template + # The login page is being rendered by the correct template self.assertTemplateUsed(res, 'registration/login.html') - # askes the user to login using a set of valid credentials - res = c.post('/login/', self.credentials, follow=True) + # asks the user to login using a set of valid credentials + res = c.post('/login/', data=self.credentials, follow=True) # The system acknowledges him self.assertTrue(res.context['user'].is_authenticated)