gnu: python-django: Do not alter PYTHONPATH.

* gnu/packages/django.scm (python-django): Remove trailing #t.
[phases]{pre-check,check}: Do not alter PYTHONPATH.
This commit is contained in:
Maxim Cournoyer 2021-01-23 00:19:29 -05:00
parent 0b701d77e7
commit 774812df96
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -74,23 +74,10 @@ (define-public python-django
(substitute* "tests/settings_tests/tests.py" (substitute* "tests/settings_tests/tests.py"
((".*def test_incorrect_timezone.*" all) ((".*def test_incorrect_timezone.*" all)
(string-append " @unittest.skipIf(True, 'Disabled by Guix')\n" (string-append " @unittest.skipIf(True, 'Disabled by Guix')\n"
all))) all)))))
;; Preserve the PYTHONPATH created by Guix when running the tests.
(substitute* "tests/admin_scripts/tests.py"
(("python_path = \\[")
(string-append "python_path = ['"
(string-join
(string-split (getenv "PYTHONPATH") #\:)
"','")
"', ")))
#t))
(replace 'check (replace 'check
(lambda _ (lambda _
(with-directory-excursion "tests" (with-directory-excursion "tests"
(setenv "PYTHONPATH"
(string-append "..:" (getenv "PYTHONPATH")))
(invoke "python" "runtests.py" (invoke "python" "runtests.py"
;; By default tests run in parallel, which may cause ;; By default tests run in parallel, which may cause
;; various race conditions. Run sequentially for ;; various race conditions. Run sequentially for