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