Exemplo n.º 1
0
    def test_it_removes_the_tag_facet_from_the_url(self,
                                                   pyramid_request):
        pyramid_request.POST['q'] = 'tag:"gar"'

        result = activity.toggle_tag_facet(pyramid_request)

        assert result.location == (
            'http://example.com/users/foo/search?q=')
Exemplo n.º 2
0
    def test_it_removes_the_tag_facet_from_the_url(self,
                                                   pyramid_request):
        pyramid_request.POST['q'] = 'tag:"gar"'

        result = activity.toggle_tag_facet(pyramid_request)

        assert result.location == (
            'http://example.com/users/foo/search?q=')
Exemplo n.º 3
0
    def test_it_preserves_query_when_removing_tag_facet(self,
                                                         pyramid_request):
        pyramid_request.POST['q'] = 'tag:"gar" foo bar'

        result = activity.toggle_tag_facet(pyramid_request)

        assert result.location == (
            'http://example.com/users/foo/search'
            '?q=foo+bar')
Exemplo n.º 4
0
    def test_it_preserves_query_when_removing_one_of_multiple_tag_facets(self,
                                                                         pyramid_request):
        pyramid_request.POST['q'] = 'tag:"foo" tag:"gar" tag:"bar"'

        result = activity.toggle_tag_facet(pyramid_request)

        assert result.location == (
            'http://example.com/users/foo/search'
            '?q=tag%3Afoo+tag%3Abar')
Exemplo n.º 5
0
    def test_it_preserves_query_when_removing_tag_facet(self,
                                                         pyramid_request):
        pyramid_request.POST['q'] = 'tag:"gar" foo bar'

        result = activity.toggle_tag_facet(pyramid_request)

        assert result.location == (
            'http://example.com/users/foo/search'
            '?q=foo+bar')
Exemplo n.º 6
0
    def test_it_adds_the_tag_facet_into_the_url(self, pyramid_request):
        result = activity.toggle_tag_facet(pyramid_request)

        assert result.location == (
            'http://example.com/users/foo/search'
            '?q=tag%3Agar')
Exemplo n.º 7
0
    def test_it_returns_a_redirect(self, pyramid_request):
        result = activity.toggle_tag_facet(pyramid_request)

        assert isinstance(result, httpexceptions.HTTPSeeOther)
Exemplo n.º 8
0
    def test_it_returns_404_when_feature_turned_off(self,
                                                    pyramid_request):
        pyramid_request.feature.flags['search_page'] = False

        with pytest.raises(httpexceptions.HTTPNotFound):
            activity.toggle_tag_facet(pyramid_request)
Exemplo n.º 9
0
    def test_it_adds_the_tag_facet_into_the_url(self, pyramid_request):
        result = activity.toggle_tag_facet(pyramid_request)

        assert result.location == (
            'http://example.com/users/foo/search'
            '?q=tag%3Agar')
Exemplo n.º 10
0
    def test_it_returns_a_redirect(self, pyramid_request):
        result = activity.toggle_tag_facet(pyramid_request)

        assert isinstance(result, httpexceptions.HTTPSeeOther)
Exemplo n.º 11
0
    def test_it_returns_404_when_feature_turned_off(self,
                                                    pyramid_request):
        pyramid_request.feature.flags['search_page'] = False

        with pytest.raises(httpexceptions.HTTPNotFound):
            activity.toggle_tag_facet(pyramid_request)