diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fd1a247f..2a704fa5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -60,10 +60,20 @@ jobs: - name: Install dependencies run: uv sync --frozen + # Import code reads/writes the Docker image's paths directly + - name: Create container paths used by the app + run: | + sudo mkdir -p /usr/src/app/temp /usr/src/app/import_presets + sudo chown -R "$(id -u):$(id -g)" /usr/src/app + - name: Check for missing migrations working-directory: app run: uv run python manage.py makemigrations --check --dry-run - name: Run tests working-directory: app + env: + # Some tests point STATIC_ROOT at the temp dir; the runner's /tmp + # holds root-only systemd dirs that WhiteNoise can't scan + TMPDIR: ${{ runner.temp }} run: uv run python manage.py test --parallel auto --noinput diff --git a/app/apps/transactions/tests/test_attachments.py b/app/apps/transactions/tests/test_attachments.py index 52f118a1..338361e6 100644 --- a/app/apps/transactions/tests/test_attachments.py +++ b/app/apps/transactions/tests/test_attachments.py @@ -193,6 +193,7 @@ class TransactionAttachmentTests(TestCase): TransactionAttachment.objects.filter(id=attachment.id).exists() ) + @override_settings(ENABLE_SOFT_DELETE=True) def test_hard_deleting_transaction_deletes_attachment_files(self): attachment = TransactionAttachment.objects.create( transaction=self.transaction,