示例#1
0
文件: accounts_test.py 项目: nlisgo/h
    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'
示例#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'
    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"
示例#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'
示例#5
0
文件: accounts_test.py 项目: nlisgo/h
    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'
示例#6
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"
示例#7
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'
示例#8
0
文件: accounts_test.py 项目: nlisgo/h
    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'