@@ -0,0 +1,39 @@
1+{ stdenv, buildPythonPackage, fetchFromGitHub, python,
2+ django, django_compat, django_nose
3+}:
4+buildPythonPackage rec {
5+ name = "django-hijack-${version}";
6+ version = "2.1.4";
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 = "1wbm6l8mzpkj4wsj4fyfamzpzi3day2v1cva5j89v4dn4403jq21";
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+ cp ../runtests.py .
27+ ${python.interpreter} runtests.py hijack
28+ popd
29+
30+ runHook postCheck
31+ '';
32+
33+ meta = with stdenv.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+}