def test_nothing_to_delete(self, db_request):
        db_request.GET["project"] = "foo"
        result = views.confirm_prohibited_project_names(db_request)

        assert result == {
            "prohibited_project_names": {"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_prohibited_project_names(db_request)

        assert result == {
            "prohibited_project_names": {"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_prohibited_project_names(request)