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
commit 0b32f6f78c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 11 deletions

View file

@ -57,6 +57,12 @@ let
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
# Paperless has explicit runtime checks that expect these binaries to be in PATH
extraBin = lib.makeBinPath [ imagemagick7 ghostscript optipng tesseract unpaper ];

View file

@ -1,5 +1,5 @@
{ lib, buildPythonPackage, fetchFromGitHub
, pytest, pytest-django, django }:
, pytest_4, pytest-django, django }:
buildPythonPackage {
pname = "django-crispy-forms";
@ -19,7 +19,7 @@ buildPythonPackage {
export sourceRoot=source-
'';
checkInputs = [ pytest pytest-django django ];
checkInputs = [ pytest_4 pytest-django django ];
checkPhase = ''
PYTHONPATH="$(pwd):$PYTHONPATH" \

View file

@ -1991,15 +1991,17 @@ in {
pyhepmc = callPackage ../development/python-modules/pyhepmc { };
pytest = if isPy3k then
callPackage ../development/python-modules/pytest {
# 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 = if isPy3k then self.pytest_5 else self.pytest_4;
pytest_5 = callPackage ../development/python-modules/pytest {
# 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 { };