summary refs log tree commit diff
path: root/gnu/packages/django.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2017-10-06 07:39:35 +0100
committerChristopher Baines <mail@cbaines.net>2017-11-24 22:16:33 +0000
commit17dc2a0997f1ed416b56122eb56d86fd65795436 (patch)
treedf2e01f65dcf1501c8c9f2a35a1245b961dbb44a /gnu/packages/django.scm
parent7a45268935f2319ae8349cafd858495dfc891a50 (diff)
downloadguix-17dc2a0997f1ed416b56122eb56d86fd65795436.tar.gz
gnu: django: Fix building python-django-allauth.
* gnu/packages/django.scm (python-django-allauth)[arguments]: Modify the
  standard phases to skip a test, and run the tests using django-admin with
  the settings configured.
Diffstat (limited to 'gnu/packages/django.scm')
-rw-r--r--gnu/packages/django.scm20
1 files changed, 20 insertions, 0 deletions
diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
index bbf231ab53..7f39817332 100644
--- a/gnu/packages/django.scm
+++ b/gnu/packages/django.scm
@@ -208,6 +208,26 @@ them do this.")
         (base32
          "1fslqc5qqb0b66yscvkyjwfv8cnbfx5nlkpnwimyb3pf1nc1w7r3"))))
     (build-system python-build-system)
+    (arguments
+     '(#: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* "allauth/socialaccount/providers/openid/tests.py"
+               (("def test_login")
+                "from django.test import tag
+    @tag('requires-web')
+    def test_login"))))
+         (replace 'check
+           (lambda _
+             (setenv "DJANGO_SETTINGS_MODULE" "test_settings")
+             (zero? (system*
+                     "django-admin"
+                     "test"
+                     "allauth"
+                     "--verbosity=2"
+                     "--exclude-tag=requires-web")))))))
     (propagated-inputs
      `(("python-openid" ,python-openid)
        ("python-requests" ,python-requests)