Exemplo n.º 1
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'
Exemplo n.º 2
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'
Exemplo n.º 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')
Exemplo n.º 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')