aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2017-10-05 21:58:07 +0100
committerChristopher Baines <mail@cbaines.net>2018-03-13 19:21:16 +0000
commitaa39e0fd24f1148d22893581e396caf47180d1c2 (patch)
treee5c8e5c32b1bffafd13a94a78c8c0cee22155f4d
parent79f450a120068ac1d2fc4e5b4b33ae938b604f95 (diff)
downloadguix-run-tests-for-python-django-gravatar2.tar
guix-run-tests-for-python-django-gravatar2.tar.gz
gnu: django: Fix the build for python-django-gravatar2.run-tests-for-python-django-gravatar2
The build was failing as the Django settings were not configured for the tests. The relevant files are missing from the release on PyPI, so switch to using a more complete source release. Also update the package at the same time. * gnu/packages/django.scm (python-django-gravatar2)[version]: 1.4.0 -> 1.4.2. [source]: Change to use a tarball from GitHub, update the sha256 hash. [arguments]: Add a phase to skip a test requiring network access, and replace the check phase to call ./manage.py within the example_project directory.
-rw-r--r--gnu/packages/django.scm33
1 files changed, 29 insertions, 4 deletions
diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
index a901af6f14..f098ca707c 100644
--- a/gnu/packages/django.scm
+++ b/gnu/packages/django.scm
@@ -271,14 +271,39 @@ account authentication.")
(source
(origin
(method url-fetch)
- (uri (pypi-uri "django-gravatar2" version))
+ (uri (string-append
+ "https://github.com/twaddington/django-gravatar/archive/"
+ version ".tar.gz"))
(sha256
(base32
- "1qsv40xywbqsf4mkrmsswrpzqd7nfljxpfiim9an2z3dykn5rka6"))))
+ "1qa0awqkfnfcjx7d5ijgr9hj8ifpq5xrj16196im4hw9r9i1wapf"))))
(build-system python-build-system)
(arguments
- '(;; TODO: The django project for the tests is missing from the release.
- #:tests? #f))
+ '(#:phases
+ (modify-phases %standard-phases
+ ;; TODO: Tagging the tests requiring the web could be done upstream.
+ (add-before 'check 'skip-test-requiring-network-access
+ (lambda _
+ (substitute* "django_gravatar/tests.py"
+ (("def test_has_gravatar")
+ "from django.test import tag
+ @tag('requires-web')
+ def test_has_gravatar"))))
+ (replace 'check
+ (lambda _
+ (setenv "PYTHONPATH"
+ (string-append
+ (getcwd)
+ ":"
+ (getenv "PYTHONPATH")))
+ (with-directory-excursion "example_project"
+ (zero?
+ (system*
+ "./manage.py"
+ "test"
+ "--verbosity=2"
+ "--exclude-tag=requires-web"
+ "django_gravatar"))))))))
(inputs
`(("python-django" ,python-django)))
(home-page "https://github.com/twaddington/django-gravatar")