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'
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
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'
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"
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
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
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
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
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
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