def METHOD_NAME(app):
    with app.app_context():
        db.drop_all()
        db.create_all()
        reindex_all(recreate=True, synchronous=True)
        ctx = app.test_request_context()
        ctx.push()
        user_count = User.query.filter_by(email='test@hepdata.net').count()
        if user_count == 0:
            user = User(email=TEST_EMAIL, password='hello1', active=True)
            admin_role = Role(name='admin')
            coordinator_role = Role(name='coordinator')
            user.roles.append(admin_role)
            user.roles.append(coordinator_role)
            db.session.add(admin_role)
            db.session.add(coordinator_role)
            db.session.add(user)
            db.session.commit()
        yield app
        ctx.pop()