1{ lib, buildPythonPackage, fetchFromGitHub, python,
2 django, django_compat, django_nose
3}:
4buildPythonPackage rec {
5 pname = "django-hijack";
6 version = "2.1.10";
7
8 # the pypi packages don't include everything required for the tests
9 src = fetchFromGitHub {
10 owner = "arteria";
11 repo = "django-hijack";
12 rev = "v${version}";
13 sha256 = "01fwkjdzvw0yx2spwi7zc1yy64ndq1y72bfmk7kxnq5x803m2ak6";
14 };
15
16 checkInputs = [ django_nose ];
17 propagatedBuildInputs = [ django django_compat ];
18
19 checkPhase = ''
20 runHook preCheck
21
22 # we have to do a little bit of tinkering to convince the tests to run against the installed package, not the
23 # source directory
24 mkdir testbase
25 pushd testbase
26 mv ../runtests.py .
27 ${python.interpreter} runtests.py hijack
28 popd
29
30 runHook postCheck
31 '';
32
33 meta = with lib; {
34 description = "Allows superusers to hijack (=login as) and work on behalf of another user";
35 homepage = "https://github.com/arteria/django-hijack";
36 license = licenses.mit;
37 maintainers = with maintainers; [ ris ];
38 };
39}