Esempio n. 1
0
    def test_login_redirect(self):
        request = self.factory.get('/acquisition_counter/')

        request.user = self.user

        response = views.login_user(request)
        self.assertEqual(response.status_code, 302)
Esempio n. 2
0
    def test_login_redirect(self):
        request = self.factory.get('/acquisition_counter/')

        request.user = self.user

        response = views.login_user(request)
        self.assertEqual(response.status_code, 302)
Esempio n. 3
0
    def test_login_wrong(self):
        request = self.factory.get('/acquisition_counter/')

        request.user = AnonymousUser()
        request.session = {}

        response = views.login_user(request)
        self.assertEqual(response.status_code, 200)
Esempio n. 4
0
    def test_login_wrong(self):
        request = self.factory.get('/acquisition_counter/')

        request.user = AnonymousUser()
        request.session = {}

        response = views.login_user(request)
        self.assertEqual(response.status_code, 200)