Esempio 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'
Esempio 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
Esempio 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'
Esempio 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"
Esempio 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
Esempio 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
Esempio 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"
Esempio 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
Esempio 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
Esempio n. 10
0
File: main_test.py Progetto: 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
Esempio 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