Exemplo n.º 1
0
Arquivo: main_test.py Projeto: gnott/h
    def test_it_redirects_to_user_activity_page(self, pyramid_request):
        pyramid_request.matchdict['user'] = '******'

        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream_user_redirect(pyramid_request)

        assert exc.value.location == 'http://example.com/user/bob'
Exemplo n.º 2
0
Arquivo: main_test.py Projeto: gnott/h
    def test_it_extracts_username_from_account_id(self, pyramid_request):
        pyramid_request.matchdict['user'] = '******'

        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream_user_redirect(pyramid_request)

        assert exc.value.location == 'http://example.com/user/bob'
Exemplo n.º 3
0
    def test_it_redirects_to_user_activity_page(self, pyramid_request):
        pyramid_request.matchdict["user"] = "******"

        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream_user_redirect(pyramid_request)

        assert exc.value.location == "http://example.com/user/bob"
Exemplo n.º 4
0
Arquivo: main_test.py Projeto: gnott/h
    def test_doesnt_choke_on_invalid_userids(self, pyramid_request):
        pyramid_request.matchdict['user'] = '******'

        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream_user_redirect(pyramid_request)

        assert exc.value.location == 'http://example.com/user/acct%3Abob'
Exemplo n.º 5
0
    def test_doesnt_choke_on_invalid_userids(self, pyramid_request):
        pyramid_request.matchdict["user"] = "******"

        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream_user_redirect(pyramid_request)

        assert exc.value.location == "http://example.com/user/acct:bob"
Exemplo n.º 6
0
    def test_it_extracts_username_from_account_id(self, pyramid_request):
        pyramid_request.matchdict["user"] = "******"

        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream_user_redirect(pyramid_request)

        assert exc.value.location == "http://example.com/user/bob"
Exemplo n.º 7
0
    def test_it_extracts_username_from_account_id(self, pyramid_request):
        pyramid_request.feature.flags['search_page'] = True
        pyramid_request.matchdict['user'] = '******'

        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream_user_redirect(pyramid_request)

        assert exc.value.location == 'http://example.com/user/bob/search'
Exemplo n.º 8
0
    def test_it_redirects_to_user_activity_page(self, pyramid_request):
        pyramid_request.feature.flags['search_page'] = True
        pyramid_request.matchdict['user'] = '******'

        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream_user_redirect(pyramid_request)

        assert exc.value.location == 'http://example.com/user/bob/search'
Exemplo n.º 9
0
    def test_it_redirects_to_stream(self, pyramid_request):
        pyramid_request.matchdict['user'] = '******'
        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream_user_redirect(pyramid_request)

        assert exc.value.location == 'http://example.com/stream?q=user%3Abob'