about summary refs log tree commit diff
path: root/pkgs/development/python-modules/django-hijack/default.nix
blob: 013df4dc0faef3c17a4d91a9f56b23f713a89301 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ lib
, fetchPypi
, buildPythonPackage
, django
, django_compat
, pytest-django
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "django-hijack";
  version = "3.2.5";

  # the wheel comes with pre-built assets, allowing us to avoid fighting
  # with npm/webpack/gettext to build them ourselves.
  format = "wheel";
  src = fetchPypi {
    inherit version format;
    pname = "django_hijack";
    dist = "py3";
    python = "py3";
    sha256 = "sha256-8BHnC3uK6zmSWKfvtDJuTjAKwQlL75G/QwRPgtNJYkE=";
  };

  propagatedBuildInputs = [ django django_compat ];

  checkInputs = [ pytestCheckHook pytest-django ];
  preCheck = ''
    export DJANGO_SETTINGS_MODULE='hijack.tests.test_app.settings'
  '';
  pytestFlagsArray = [ "--pyargs" "hijack" ];

  meta = with 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 ];
  };
}