def test_form_request_user_strips_spaces(self, nipsa_service, pyramid_request, users): pyramid_request.params = { "add": " carl ", "authority": " foo.org " } nipsa_add(pyramid_request) assert users['carl'] in nipsa_service.flagged
def test_add_redirects_to_index(self, pyramid_request): pyramid_request.params = {"add": "carl", "authority": "foo.org"} result = nipsa_add(pyramid_request) assert isinstance(result, httpexceptions.HTTPSeeOther) assert result.location == '/adm/nipsa'
def test_add_redirects_to_index(self, pyramid_request): pyramid_request.params = {"add": "carl", "authority": "foo.org"} result = nipsa_add(pyramid_request) assert isinstance(result, httpexceptions.HTTPSeeOther) assert result.location == '/adm/nipsa'
def test_add_raises_when_user_not_found(self, user, nipsa_service, pyramid_request): pyramid_request.params = {"add": user, "authority": "example.com"} with pytest.raises(UserNotFoundError): nipsa_add(pyramid_request)
def test_add_flags_user(self, nipsa_service, pyramid_request, users): pyramid_request.params = {"add": "carl", "authority": "foo.org"} nipsa_add(pyramid_request) assert users['carl'] in nipsa_service.flagged
def test_form_request_user_strips_spaces(self, nipsa_service, pyramid_request, users): pyramid_request.params = {"add": " carl ", "authority": " foo.org "} nipsa_add(pyramid_request) assert users['carl'] in nipsa_service.flagged
def test_add_raises_when_user_not_found(self, user, nipsa_service, pyramid_request): pyramid_request.params = {"add": user, "authority": "example.com"} with pytest.raises(UserNotFoundError): nipsa_add(pyramid_request)
def test_add_flags_user(self, nipsa_service, pyramid_request, users): pyramid_request.params = {"add": "carl", "authority": "foo.org"} nipsa_add(pyramid_request) assert users['carl'] in nipsa_service.flagged