Fix tests

These were failing due to pytest defaulting to `DEBUG = False` (and then getting
`ValueError: Missing staticfiles manifest entry for ...`).
This commit is contained in:
Ben Sturmfels 2024-07-22 16:43:37 +10:00
parent 6636119200
commit 1a5441ba75
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0
2 changed files with 24 additions and 0 deletions

6
bin/test Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env sh
set -e # Abort on failure
set -x
python3 -m pytest

18
pyproject.toml Normal file
View file

@ -0,0 +1,18 @@
[tool.black]
skip-string-normalization = true
line-length = 90
[tool.isort]
profile = "black"
force_sort_within_sections = true
line_length = 90
sections = "FUTURE,STDLIB,THIRDPARTY,LOCALFOLDER,FIRSTPARTY"
no_lines_before = "FIRSTPARTY"
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = 'conservancy.settings.dev'
python_files = ['test*.py']
# pytest-django will default to running tests with DEBUG = False, regardless of
# the settings you provide it. This fails due to the
# `ManifestStaticFilesStorage` without explicitly running `collectstatic` first.
django_debug_mode = true