From 8202b734a637924ca330287274bbfbcb2900425c Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 30 Jan 2024 10:25:41 -0800 Subject: [PATCH] help: tests: Run tests using doc in current dir instead of /usr - This prevents the test from failing if install has not run yet. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/help/tests/test_views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plinth/modules/help/tests/test_views.py b/plinth/modules/help/tests/test_views.py index b61730329..48b1445ba 100644 --- a/plinth/modules/help/tests/test_views.py +++ b/plinth/modules/help/tests/test_views.py @@ -19,7 +19,7 @@ from django import urls from django.conf import settings from django.http import Http404 -from plinth import module_loader +from plinth import cfg, module_loader from plinth.modules.help import views # For all tests, use plinth.urls instead of urls configured for testing @@ -42,6 +42,12 @@ def fixture_app_urls(): yield +@pytest.fixture(autouse=True, scope='module') +def fixture_developer_configuration(): + """Make sure docs are read from current directory instead of /usr.""" + cfg.read_file(cfg.get_develop_config_path()) + + @pytest.mark.parametrize("view_name, view", ( ('feedback', views.feedback), ('support', views.support),