Exemplo n.º 1
0
    def test_it_redirects_to_activity_page_if_q_length_great_than_2(self, sidebar_app, pyramid_request):
        pyramid_request.params['q'] = 'tag:foo:bar'
        pyramid_request.matchdict['tag'] = 'foo:bar'
        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream(None, pyramid_request)

        assert exc.value.location == 'http://example.com/search?q=tag%3Afoo%3Abar'
Exemplo n.º 2
0
    def test_it_does_not_redirect_to_activity_page_if_no_tag_key_value(
            self, sidebar_app, pyramid_request):
        pyramid_request.params['q'] = 'tag-foo'

        main.stream(None, pyramid_request)

        assert sidebar_app.called
Exemplo n.º 3
0
    def test_it_redirects_to_activity_page_with_tags_containing_spaces(self, pyramid_request):
        pyramid_request.params['q'] = 'tag:foo bar'
        pyramid_request.matchdict['tag'] = 'foo bar'
        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream(None, pyramid_request)

        assert exc.value.location == 'http://example.com/search?q=tag%3A%22foo+bar%22'
Exemplo n.º 4
0
    def test_it_redirects_to_activity_page_with_tags(self, pyramid_request):
        pyramid_request.params["q"] = "tag:foo"
        pyramid_request.matchdict["tag"] = "foo"
        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream(None, pyramid_request)

        assert exc.value.location == "http://example.com/search?q=tag%3Afoo"
Exemplo n.º 5
0
    def test_it_does_not_redirect_to_activity_page_if_no_q_param(
            self, sidebar_app, pyramid_request):
        pyramid_request.matchdict['tag'] = 'foo'

        main.stream(None, pyramid_request)

        assert sidebar_app.called
Exemplo n.º 6
0
    def test_it_does_not_redirect_to_activity_page_if_no_tag_key(
            self, sidebar_app, pyramid_request):
        pyramid_request.params["q"] = "foo"

        main.stream(None, pyramid_request)

        assert sidebar_app.called
Exemplo n.º 7
0
    def test_it_redirects_to_activity_page_with_tags(self, pyramid_request):
        pyramid_request.params["q"] = "tag:foo"
        pyramid_request.matchdict["tag"] = "foo"
        with pytest.raises(httpexceptions.HTTPFound) as exc:
            main.stream(None, pyramid_request)

        assert exc.value.location == "http://example.com/search?q=tag%3Afoo"
Exemplo n.º 8
0
    def test_it_does_not_redirect_to_activity_page_if_no_tag_key_value(
        self, sidebar_app, pyramid_request
    ):
        pyramid_request.params["q"] = "tag-foo"

        main.stream(None, pyramid_request)

        assert sidebar_app.called
Exemplo n.º 9
0
    def test_it_does_not_redirect_to_activity_page_if_no_q_param(
        self, sidebar_app, pyramid_request
    ):
        pyramid_request.matchdict["tag"] = "foo"

        main.stream(None, pyramid_request)

        assert sidebar_app.called
Exemplo n.º 10
0
Arquivo: main_test.py Projeto: gnott/h
    def test_it_does_not_redirect_to_activity_page_if_no_tag_key(self, sidebar_app, pyramid_request):
        pyramid_request.params['q'] = 'foo'

        main.stream(None, pyramid_request)

        assert sidebar_app.called
Exemplo n.º 11
0
    def test_it_does_not_redirect_to_activity_page_if_no_tag_key(self, render_app, pyramid_request):
        pyramid_request.params['q'] = 'foo'

        main.stream(None, pyramid_request)

        assert render_app.called