From 039e248555935580b0551b3e1aaa466067c66151 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Sun, 6 Sep 2020 12:15:20 +0200 Subject: [PATCH] python3Packages.django-picklefield: fix tests --- .../django-picklefield/default.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/django-picklefield/default.nix b/pkgs/development/python-modules/django-picklefield/default.nix index a9a03e9066c4..4710de2c7ecb 100644 --- a/pkgs/development/python-modules/django-picklefield/default.nix +++ b/pkgs/development/python-modules/django-picklefield/default.nix @@ -1,16 +1,27 @@ -{ lib, buildPythonPackage, fetchPypi, django }: +{ lib, buildPythonPackage, fetchFromGitHub, django, pytest, pytest-django }: buildPythonPackage rec { pname = "django-picklefield"; version = "3.0.1"; - src = fetchPypi { - inherit pname version; - sha256 = "15ccba592ca953b9edf9532e64640329cd47b136b7f8f10f2939caa5f9ce4287"; + # The PyPi source doesn't contain tests + src = fetchFromGitHub { + owner = "gintas"; + repo = pname; + rev = "v${version}"; + sha256 = "0ni7bc86k0ra4pc8zv451pzlpkhs1nyil1sq9jdb4m2mib87b5fk"; }; propagatedBuildInputs = [ django ]; + checkInputs = [ pytest pytest-django ]; + + checkPhase = '' + PYTHONPATH="$(pwd):$PYTHONPATH" \ + DJANGO_SETTINGS_MODULE=tests.settings \ + pytest tests/tests.py + ''; + meta = { description = "A pickled object field for Django"; homepage = "https://github.com/gintas/django-picklefield";