Subject: [PATCH v1] gnu: python-django-compressor: Run tests against installed package.

From: Evgeny Pisemsky <[email-masked]>
Date: Sat, 19 Apr 2025 15:37:22 +0300

* gnu/packages/django.scm (python-django-compressor): Run tests against installed package.

Change-Id: Idd810376921d1802adb9355c52edcd1a8584eef7
---
 gnu/packages/django.scm | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
index 8175e0ad6c..d152e05d87 100644
--- a/gnu/packages/django.scm
+++ b/gnu/packages/django.scm
@@ -1471,14 +1471,11 @@ (define-public python-django-compressor
         (add-after 'unpack 'add-missing-init-files
           (lambda _
             (substitute* "setup.py"
-              (("package_data=.*,") "include_package_data=True,"))
-            (call-with-output-file "compressor/templates/__init__.py"
-              (const #t))
-            (call-with-output-file "compressor/templates/compressor/__init__.py"
-              (const #t))))
+              (("package_data=.*,") "include_package_data=True,"))))
         (replace 'check
-          (lambda* (#:key tests? #:allow-other-keys)
+          (lambda* (#:key tests? inputs outputs #:allow-other-keys)
             (when tests?
+              (chdir (site-packages inputs outputs))
               (setenv "DJANGO_SETTINGS_MODULE" "compressor.test_settings")
               (invoke "django-admin" "test"
                       "--pythonpath=.")))))))

base-commit: d5fc8668f461e6f2246a2861ad53df725c7dd766
-- 
2.49.0