import pytest from lb_app import create_app from lb_app.app_db.db import MongoDB import pprint data = {'username': 'neo'} @pytest.fixture def app(): app = create_app({ 'TESTING': True }) app.config.from_mapping( MONGO_URI= 'mongodb://localhost:27017/test_liberationCenter' ) with app.app_context(): db = MongoDB(app) db.set_up() mongo = db.connection() mongo.db.users.insert_one(data) yield app @pytest.fixture def client(app): return app.test_client() @pytest.fixture def runner(app): return app.test_cli_runner()