forgot to follow the redirect at landing page

pull/8/head
Ves Nikos 2016-09-10 13:08:31 +01:00
rodzic a25d38274a
commit 70638b01a2
1 zmienionych plików z 4 dodań i 6 usunięć

Wyświetl plik

@ -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)