def test_it_returns_a_redirect(self, pyramid_request): result = activity.delete_lozenge(pyramid_request) assert isinstance(result, httpexceptions.HTTPSeeOther) # This tests that the location redirect to is correct and also that # the delete_lozenge param has been removed (and is not part of the # URL). assert result.location == 'http://example.com/search'
def test_it_preserves_the_query_param(self, pyramid_request): pyramid_request.POST['q'] = 'foo bar' location = activity.delete_lozenge(pyramid_request).location location == 'http://example.com/search?q=foo+bar'