From 5bcc1ed9df4e7a6b8086cac3f25a466aee3bebcd Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 16 Jun 2018 17:52:31 +0200 Subject: Add first structure of the application --- src/tests/conftest.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/tests/conftest.py (limited to 'src/tests/conftest.py') diff --git a/src/tests/conftest.py b/src/tests/conftest.py new file mode 100644 index 0000000..6a54ae4 --- /dev/null +++ b/src/tests/conftest.py @@ -0,0 +1,34 @@ +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() -- cgit v1.2.1