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