def test_nothing_to_delete(self, db_request): db_request.GET["project"] = "foo" result = views.confirm_blacklist(db_request) assert result == { "blacklist": {"project": "foo", "comment": ""}, "existing": {"project": None, "releases": [], "files": [], "roles": []}, }
def test_nothing_to_delete(self, db_request): db_request.GET["project"] = "foo" result = views.confirm_blacklist(db_request) assert result == { "blacklist": {"project": "foo", "comment": ""}, "existing": {"project": None, "releases": [], "files": [], "roles": []}, }
def test_stuff_to_delete(self, db_request): project = ProjectFactory.create() db_request.GET["project"] = project.name result = views.confirm_blacklist(db_request) assert result == { "blacklist": {"project": project.name, "comment": ""}, "existing": {"project": project, "releases": [], "files": [], "roles": []}, }
def test_stuff_to_delete(self, db_request): project = ProjectFactory.create() db_request.GET["project"] = project.name result = views.confirm_blacklist(db_request) assert result == { "blacklist": {"project": project.name, "comment": ""}, "existing": {"project": project, "releases": [], "files": [], "roles": []}, }
def test_no_project(self): request = pretend.stub(GET={}) with pytest.raises(HTTPBadRequest): views.confirm_blacklist(request)
def test_no_project(self): request = pretend.stub(GET={}) with pytest.raises(HTTPBadRequest): views.confirm_blacklist(request)