about summary refs log tree commit diff
path: root/pkgs/development/python-modules/django-postgresql-netfields
diff options
context:
space:
mode:
authorYureka <yuka@yuka.dev>2023-09-25 21:00:33 +0200
committerYureka <yuka@yuka.dev>2023-09-25 22:54:07 +0200
commite11d9b590234220c77335767ffe716d627d23085 (patch)
tree208f4e5a8e6eff217527bda098c89ef91d99e2dc /pkgs/development/python-modules/django-postgresql-netfields
parent058d9b8ff5200e8915e36df6214a3fb1577e0ecb (diff)
python3.pkgs.django-postgresql-netfields: run tests
Diffstat (limited to 'pkgs/development/python-modules/django-postgresql-netfields')
-rw-r--r--pkgs/development/python-modules/django-postgresql-netfields/default.nix37
1 files changed, 19 insertions, 18 deletions
diff --git a/pkgs/development/python-modules/django-postgresql-netfields/default.nix b/pkgs/development/python-modules/django-postgresql-netfields/default.nix
index 5564e0f6de22d..6a770fec8148b 100644
--- a/pkgs/development/python-modules/django-postgresql-netfields/default.nix
+++ b/pkgs/development/python-modules/django-postgresql-netfields/default.nix
@@ -1,13 +1,18 @@
-{ lib
+{ stdenv
+, lib
 , buildPythonPackage
 , django
 , netaddr
 , six
 , fetchFromGitHub
 , pythonOlder
+, djangorestframework
 # required for tests
-#, djangorestframework
-#, psycopg2
+, postgresql
+, postgresqlTestHook
+, psycopg2
+, pytestCheckHook
+, pytest-django
 }:
 
 buildPythonPackage rec {
@@ -30,23 +35,19 @@ buildPythonPackage rec {
     six
   ];
 
-  # tests need a postgres database
-  doCheck = false;
+  doCheck = !stdenv.isDarwin; # could not create shared memory segment: Operation not permitted
 
-  # keeping the dependencies below as comment for reference
-  # checkPhase = ''
-    # python manage.py test
-  # '';
-
-  # buildInputs = [
-    # djangorestframework
-    # psycopg2
-  # ];
+  nativeCheckInputs = [
+    djangorestframework
+    postgresql
+    postgresqlTestHook
+    psycopg2
+    pytestCheckHook
+    pytest-django
+  ];
 
-  # Requires psycopg2
-  # pythonImportsCheck = [
-  #   "netfields"
-  # ];
+  postgresqlTestUserOptions = "LOGIN SUPERUSER";
+  env.DJANGO_SETTINGS_MODULE = "testsettings";
 
   meta = with lib; {
     description = "Django PostgreSQL netfields implementation";