def METHOD_NAME(db_request, flash):
    user = UserFactory.create()
    project = ProjectFactory.create(name="foo")
    release = ReleaseFactory.create(project=project)
    FileFactory.create(release=release, filename="who cares")
    RoleFactory.create(user=user, project=project)
    DependencyFactory.create(release=release)
    db_request.user = user
    db_request.session = stub(flash=call_recorder(lambda *a, **kw: stub()))
    remove_project(project, db_request, flash=flash)
    if flash:
        assert db_request.session.flash.calls == [
            call("Deleted the project 'foo'", queue="success")
        ]
    else:
        assert db_request.session.flash.calls == []
    assert not (db_request.db.query(Role).filter(Role.project == project).count())
    assert not (
        db_request.db.query(File)
        .join(Release)
        .join(Project)
        .filter(Release.project == project)
        .count()
    )
    assert not (
        db_request.db.query(Dependency)
        .join(Release)
        .filter(Release.project == project)
        .count()
    )
    assert not (db_request.db.query(Release).filter(Release.project == project).count())
    assert not (
        db_request.db.query(Project).filter(Project.name == project.name).count()
    )
    journal_entry = (
        db_request.db.query(JournalEntry)
        .options(joinedload(JournalEntry.submitted_by))
        .filter(JournalEntry.name == "foo")
        .one()
    )
    assert journal_entry.action == "remove project"
    assert journal_entry.submitted_by == db_request.user