diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd67afd3a..19539e631 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,6 +123,8 @@ jobs: with: python-version: "3.11" cache: pip + - name: Install Cookiecutter + run: pip install cookiecutter - name: Generate project run: cookiecutter . --no-input project_slug=test_project - name: Install production dependencies diff --git a/tests/test_production_build.py b/tests/test_production_build.py index 82ddeba20..dd7df7cc7 100644 --- a/tests/test_production_build.py +++ b/tests/test_production_build.py @@ -1,7 +1,14 @@ import os import subprocess +import pytest def test_production_check(): - base_dir = os.getcwd() - manage_py_path = os.path.join(base_dir, "test_project", "manage.py") + # Get the absolute path to the manage.py file + base_dir = os.path.dirname(os.path.abspath(__file__)) + manage_py_path = os.path.join(base_dir, '..', 'test_project', 'manage.py') + + # Ensure the path exists before proceeding + assert os.path.exists(manage_py_path), f"Expected path {manage_py_path} does not exist." + + # Run the Django deployment checks subprocess.check_call(['python', manage_py_path, 'check', '--deploy']) \ No newline at end of file