Skip to content

Commit f6b2dbf

Browse files
committed
Fix Django test configuration and deployment permissions
- Add pytest Django settings configuration to pyproject.toml to resolve 'ImproperlyConfigured: settings are not configured' test errors - Add venv write permissions fix to deploy.sh to allow package installation without permission errors during deployment
1 parent 258709a commit f6b2dbf

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

deploy.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ fi
8383
chown $USERNAME:$USERNAME -R $WWW_PATH
8484
chown $USERNAME:$USERNAME -R $VENV_PATH
8585

86+
# Fix venv permissions for package installation
87+
chmod -R u+w $VENV_PATH
88+
8689
# Run database migrations
8790
su - $USERNAME -c "$VENV_PATH/bin/python $CODE_PATH/roundware/manage.py migrate --noinput"
8891

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,9 @@ test = [
9393
version = { attr = "roundware.__version__"}
9494

9595
[tool.setuptools.packages.find]
96-
where = ["."]
96+
where = ["."]
97+
98+
[tool.pytest.ini_options]
99+
DJANGO_SETTINGS_MODULE = "roundware.settings.testing"
100+
python_files = ["tests.py", "test_*.py", "*_tests.py"]
101+
addopts = "--nomigrations --reuse-db"

0 commit comments

Comments
 (0)