diff --git a/src/microcosm/__init__.py b/src/microcosm/__init__.py index b95240a..7366ead 100644 --- a/src/microcosm/__init__.py +++ b/src/microcosm/__init__.py @@ -39,7 +39,7 @@ def create_app(): app.config.from_file(os.path.join(os.getcwd(), "config.yaml"), yaml.safe_load) - from .micropub import micropub, auth_bp + from .indieauth import micropub, auth_bp from .webmentions import webhook_bp print(app.config) diff --git a/test/test_create_post.py b/test/test_create_post.py index a677660..fa27c17 100644 --- a/test/test_create_post.py +++ b/test/test_create_post.py @@ -27,7 +27,9 @@ def test_no_token_request(mocker): rget = mocker.patch('microcosm.requests.get') - with microcosm.app.test_client() as c: + app = microcosm.create_app() + + with app.test_client() as c: response = c.get("/") assert response.status_code == 401 assert response.json.get("error") == "unauthorized" @@ -41,7 +43,9 @@ def test_invalid_token_request(mocker): rget = mocker.patch('microcosm.requests.get', side_effect=expect_json_response({"me":"https://someothersite.com/"})) - with microcosm.app.test_client() as c: + app = microcosm.create_app() + + with app.test_client() as c: response = c.get("/", headers={'Authorization': 'Bearer SomeTestTokenValue'}) assert response.status_code == 401 assert response.json.get("error") == "insufficient_scope"