示例#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=')
示例#2
0
文件: activity_test.py 项目: nlisgo/h
    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=')
示例#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')
示例#4
0
文件: activity_test.py 项目: nlisgo/h
    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')
示例#5
0
文件: activity_test.py 项目: nlisgo/h
    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')
示例#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')
示例#7
0
    def test_it_returns_a_redirect(self, pyramid_request):
        result = activity.toggle_tag_facet(pyramid_request)

        assert isinstance(result, httpexceptions.HTTPSeeOther)
示例#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)
示例#9
0
文件: activity_test.py 项目: nlisgo/h
    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')
示例#10
0
文件: activity_test.py 项目: nlisgo/h
    def test_it_returns_a_redirect(self, pyramid_request):
        result = activity.toggle_tag_facet(pyramid_request)

        assert isinstance(result, httpexceptions.HTTPSeeOther)
示例#11
0
文件: activity_test.py 项目: nlisgo/h
    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)