Fix tests?
This commit is contained in:
parent
94b921230a
commit
715b0258ae
2 changed files with 8 additions and 1 deletions
5
.github/workflows/docker.yaml
vendored
5
.github/workflows/docker.yaml
vendored
|
|
@ -10,6 +10,7 @@ on:
|
|||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
DJANGO_DEBUG: False
|
||||
DJANGO_SECRET_KEY: 1234567890
|
||||
|
|
@ -41,7 +42,11 @@ jobs:
|
|||
- run: uv run pytest
|
||||
|
||||
- run: uv run python manage.py makemigrations --check
|
||||
env:
|
||||
TESTING: True
|
||||
- run: uv run python manage.py migrate
|
||||
env:
|
||||
TESTING: True
|
||||
- run: uv run python manage.py collectstatic --noinput
|
||||
- id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
|
|
|
|||
|
|
@ -246,6 +246,8 @@ def test_database_settings_when_not_testing(
|
|||
monkeypatch.delenv("PYTEST_VERSION", raising=False)
|
||||
|
||||
reloaded: ModuleType = reload_settings_module(
|
||||
TESTING=None,
|
||||
PYTEST_VERSION=None,
|
||||
POSTGRES_DB="prod_db",
|
||||
POSTGRES_USER="prod_user",
|
||||
POSTGRES_PASSWORD="secret",
|
||||
|
|
@ -275,7 +277,7 @@ def test_debug_tools_installed_only_when_not_testing(
|
|||
# Not testing -> tools should be present
|
||||
monkeypatch.setattr("sys.argv", ["manage.py", "runserver"])
|
||||
monkeypatch.delenv("PYTEST_VERSION", raising=False)
|
||||
not_testing: ModuleType = reload_settings_module()
|
||||
not_testing: ModuleType = reload_settings_module(TESTING=None, PYTEST_VERSION=None)
|
||||
assert "debug_toolbar" in not_testing.INSTALLED_APPS
|
||||
assert "silk" in not_testing.INSTALLED_APPS
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue