summary refs log tree commit diff
path: root/pkgs/development/python-modules/django-hijack
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2017-05-28 12:24:02 +0100
committerRobert Scott <code@humanleg.org.uk>2017-05-28 14:43:41 +0100
commitfa44b72d91625bcf5aee5438b10abdd0eb4e5acb (patch)
tree413060f088f2e2e656e2425c254694ea5258099b /pkgs/development/python-modules/django-hijack
parentac8a58b5b44859f805e9613ec6cd55c3904ecbc0 (diff)
downloadnixlib-fa44b72d91625bcf5aee5438b10abdd0eb4e5acb.tar
nixlib-fa44b72d91625bcf5aee5438b10abdd0eb4e5acb.tar.gz
nixlib-fa44b72d91625bcf5aee5438b10abdd0eb4e5acb.tar.bz2
nixlib-fa44b72d91625bcf5aee5438b10abdd0eb4e5acb.tar.lz
nixlib-fa44b72d91625bcf5aee5438b10abdd0eb4e5acb.tar.xz
nixlib-fa44b72d91625bcf5aee5438b10abdd0eb4e5acb.tar.zst
nixlib-fa44b72d91625bcf5aee5438b10abdd0eb4e5acb.zip
python.pkgs.django_hijack: 2.0.7 -> 2.1.4
also fix & enable tests, add self as maintainer
Diffstat (limited to 'pkgs/development/python-modules/django-hijack')
-rw-r--r--pkgs/development/python-modules/django-hijack/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/django-hijack/default.nix b/pkgs/development/python-modules/django-hijack/default.nix
new file mode 100644
index 000000000000..8eb98924491a
--- /dev/null
+++ b/pkgs/development/python-modules/django-hijack/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, buildPythonPackage, fetchFromGitHub, python,
+  django, django_compat, django_nose
+}:
+buildPythonPackage rec {
+  name = "django-hijack-${version}";
+  version = "2.1.4";
+
+  # the pypi packages don't include everything required for the tests
+  src = fetchFromGitHub {
+    owner = "arteria";
+    repo = "django-hijack";
+    rev = "v${version}";
+    sha256 = "1wbm6l8mzpkj4wsj4fyfamzpzi3day2v1cva5j89v4dn4403jq21";
+  };
+
+  checkInputs = [ django_nose ];
+  propagatedBuildInputs = [ django django_compat ];
+
+  checkPhase = ''
+    runHook preCheck
+
+    # we have to do a little bit of tinkering to convince the tests to run against the installed package, not the
+    # source directory
+    mkdir testbase
+    pushd testbase
+    cp ../runtests.py .
+    ${python.interpreter} runtests.py hijack
+    popd
+
+    runHook postCheck
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Allows superusers to hijack (=login as) and work on behalf of another user";
+    homepage = https://github.com/arteria/django-hijack;
+    license = licenses.mit;
+    maintainers = with maintainers; [ ris ];
+  };
+}
\ No newline at end of file