示例#1
0
    def test_remove_redirects_to_index(self, pyramid_request):
        pyramid_request.params = {"remove": "blocked1"}

        result = badge_remove(pyramid_request)

        assert isinstance(result, httpexceptions.HTTPSeeOther)
        assert result.location == "/adm/badge"
示例#2
0
    def test_remove_redirects_to_index_even_if_not_blocked(
            self, pyramid_request):
        pyramid_request.params = {'remove': 'test_uri'}

        result = badge_remove(pyramid_request)

        assert isinstance(result, httpexceptions.HTTPSeeOther)
        assert result.location == '/adm/badge'
示例#3
0
    def test_remove_unblocks_uri(self, pyramid_request):
        pyramid_request.params = {"remove": "blocked2"}

        badge_remove(pyramid_request)

        assert not models.Blocklist.is_blocked(pyramid_request.db, "blocked2")
示例#4
0
    def test_remove_unblocks_uri(self, pyramid_request):
        pyramid_request.params = {'remove': 'blocked2'}

        badge_remove(pyramid_request)

        assert not models.Blocklist.is_blocked(pyramid_request.db, 'blocked2')