Ejemplo n.º 1
0
    def test_authenticate_two_factor_with_next_url(self):
        fake_session = sessions.Session(data={'next_url': '/someendpoint/'})
        sessions.set_session(fake_session)

        response = authenticate_two_factor(self.user)
        assert_true(isinstance(response, BaseResponse))

        assert_equal(
            response.location,
            u'{0}?next=%2Fsomeendpoint%2F'.format(web_url_for('two_factor')))
        assert_equal(response.status_code, 302)
Ejemplo n.º 2
0
    def test_authenticate_two_factor_with_next_url(self):
        fake_session = sessions.Session(data={'next_url': '/someendpoint/'})
        sessions.set_session(fake_session)

        response = authenticate_two_factor(self.user)
        assert_true(isinstance(response, BaseResponse))

        assert_equal(response.location,
                     u'{0}?next=%2Fsomeendpoint%2F'.format(web_url_for('two_factor'))
        )
        assert_equal(response.status_code, 302)
Ejemplo n.º 3
0
 def test_authenticate_two_factor_returns_correct_response(self):
     response = authenticate_two_factor(self.user)
     assert_true(isinstance(response, BaseResponse))
     assert_equal(response.location, web_url_for('two_factor'))
     assert_equal(response.status_code, 302)
Ejemplo n.º 4
0
 def test_authenticate_two_factor_returns_correct_response(self):
     response = authenticate_two_factor(self.user)
     assert_true(isinstance(response, BaseResponse))
     assert_equal(response.location, web_url_for('two_factor'))
     assert_equal(response.status_code, 302)