Merge pull request #68786 from JohnAZoidberg/paperless-testfix

paperless: Fix tests, including NixOS test
This commit is contained in:
Maximilian Bosch
2019-09-14 15:17:59 +02:00
committed by GitHub
4 changed files with 19 additions and 11 deletions
@@ -57,6 +57,12 @@ let
cp -r --no-preserve=mode $src/src/* $src/LICENSE $srcDir cp -r --no-preserve=mode $src/src/* $src/LICENSE $srcDir
''; '';
postPatch = ''
# django-cors-headers 3.x requires a scheme for allowed hosts
substituteInPlace $out/share/paperless/paperless/settings.py \
--replace "localhost:8080" "http://localhost:8080"
'';
buildPhase = let buildPhase = let
# Paperless has explicit runtime checks that expect these binaries to be in PATH # Paperless has explicit runtime checks that expect these binaries to be in PATH
extraBin = lib.makeBinPath [ imagemagick7 ghostscript optipng tesseract unpaper ]; extraBin = lib.makeBinPath [ imagemagick7 ghostscript optipng tesseract unpaper ];
@@ -1,5 +1,5 @@
{ lib, buildPythonPackage, fetchFromGitHub { lib, buildPythonPackage, fetchFromGitHub
, pytest, pytest-django, django }: , pytest_4, pytest-django, django }:
buildPythonPackage { buildPythonPackage {
pname = "django-crispy-forms"; pname = "django-crispy-forms";
@@ -19,7 +19,7 @@ buildPythonPackage {
export sourceRoot=source- export sourceRoot=source-
''; '';
checkInputs = [ pytest pytest-django django ]; checkInputs = [ pytest_4 pytest-django django ];
checkPhase = '' checkPhase = ''
PYTHONPATH="$(pwd):$PYTHONPATH" \ PYTHONPATH="$(pwd):$PYTHONPATH" \
+11 -9
View File
@@ -1991,15 +1991,17 @@ in {
pyhepmc = callPackage ../development/python-modules/pyhepmc { }; pyhepmc = callPackage ../development/python-modules/pyhepmc { };
pytest = if isPy3k then pytest = if isPy3k then self.pytest_5 else self.pytest_4;
callPackage ../development/python-modules/pytest {
# hypothesis tests require pytest that causes dependency cycle pytest_5 = callPackage ../development/python-modules/pytest {
hypothesis = self.hypothesis.override { doCheck = false; }; # hypothesis tests require pytest that causes dependency cycle
} hypothesis = self.hypothesis.override { doCheck = false; };
else callPackage ../development/python-modules/pytest/2.nix { };
# hypothesis tests require pytest that causes dependency cycle
hypothesis = self.hypothesis.override { doCheck = false; }; pytest_4 = callPackage ../development/python-modules/pytest/4.nix {
}; # hypothesis tests require pytest that causes dependency cycle
hypothesis = self.hypothesis.override { doCheck = false; };
};
pytest-helpers-namespace = callPackage ../development/python-modules/pytest-helpers-namespace { }; pytest-helpers-namespace = callPackage ../development/python-modules/pytest-helpers-namespace { };