diff --git a/ckanext/let_me_in/tests/test_auth.py b/ckanext/let_me_in/tests/test_auth.py index 93774aa..8e0ca0c 100644 --- a/ckanext/let_me_in/tests/test_auth.py +++ b/ckanext/let_me_in/tests/test_auth.py @@ -7,6 +7,7 @@ from ckan.tests.helpers import call_auth +@pytest.mark.usefixtures("non_clean_db", "with_plugins") class TestGenerateOTLAuth: def test_anon(self): with pytest.raises(tk.NotAuthorized): diff --git a/ckanext/let_me_in/tests/test_views.py b/ckanext/let_me_in/tests/test_views.py index 1daca4b..babd5de 100644 --- a/ckanext/let_me_in/tests/test_views.py +++ b/ckanext/let_me_in/tests/test_views.py @@ -8,18 +8,16 @@ from ckan.tests.helpers import call_action -@pytest.mark.usefixtures("non_clean_db") +@pytest.mark.usefixtures("non_clean_db", "with_plugins") class TestOTLViews(object): def test_login_user_with_otl(self, app, user): otl = call_action("lmi_generate_otl", uid=user["id"]) - result = app.get(otl["url"], status=200) - assert "You have been logged in" in result.text + assert "You have been logged in" in app.get(otl["url"]).body - result = app.get(otl["url"], status=200) assert ( "You have tried to use a one-time login link that has expired" - in result.text + in app.get(otl["url"]).body ) def test_user_login_expires_the_otl(self, app, user): @@ -31,8 +29,7 @@ def test_user_login_expires_the_otl(self, app, user): user = cast(model.User, model.User.get(user["id"])) user.set_user_last_active() - result = app.get(otl["url"], status=200) assert ( "You have tried to use a one-time login link that has expired" - in result.text + in app.get(otl["url"]).body )