예제 #1
0
파일: test_core.py 프로젝트: pazthor/osf.io
    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)
예제 #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)
예제 #3
0
파일: test_core.py 프로젝트: pazthor/osf.io
 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)
예제 #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)