Esempio n. 1
0
    def test_it_returns_login_with_root_when_hostnames_are_different(self, pyramid_request):
        pyramid_request.domain = 'example.org'
        pyramid_request.referer = 'http://example.com/account/settings'

        result = views.bad_csrf_token_html(None, pyramid_request)

        assert result['login_path'] == '/login?next=%2F'
Esempio n. 2
0
    def test_it_returns_login_with_root_when_hostnames_are_different(
            self, pyramid_request):
        pyramid_request.domain = 'example.org'
        pyramid_request.referer = 'http://example.com/account/settings'

        result = views.bad_csrf_token_html(None, pyramid_request)

        assert result['login_path'] == '/login?next=%2F'
Esempio n. 3
0
    def test_it_returns_login_with_referer_path_as_next(self, pyramid_request):
        pyramid_request.referer = 'http://' + \
                                  pyramid_request.domain + \
                                  '/account/settings'

        result = views.bad_csrf_token_html(None, pyramid_request)

        assert result['login_path'] == '/login?next=%2Faccount%2Fsettings'
Esempio n. 4
0
    def test_it_returns_login_with_referer_path_as_next(self, pyramid_request):
        pyramid_request.referer = 'http://' + \
                                  pyramid_request.domain + \
                                  '/account/settings'

        result = views.bad_csrf_token_html(None, pyramid_request)

        assert result['login_path'] == '/login?next=%2Faccount%2Fsettings'
Esempio n. 5
0
    def test_it_returns_login_with_root_next_as_default(self, pyramid_request):
        pyramid_request.referer = None
        result = views.bad_csrf_token_html(None, pyramid_request)

        assert result['login_path'] == '/login?next=%2F'
Esempio n. 6
0
    def test_it_returns_login_with_root_next_as_default(self, pyramid_request):
        pyramid_request.referer = None
        result = views.bad_csrf_token_html(None, pyramid_request)

        assert result['login_path'] == '/login?next=%2F'