From 59e492ebefed773945fdb90b5d03578a6d386ecb Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 6 Aug 2022 22:20:34 +0100 Subject: [PATCH] python3Packages.django-storages: enable tests --- .../django-storages/default.nix | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/django-storages/default.nix b/pkgs/development/python-modules/django-storages/default.nix index 25a6e561789a..ce2fd661b8c3 100644 --- a/pkgs/development/python-modules/django-storages/default.nix +++ b/pkgs/development/python-modules/django-storages/default.nix @@ -1,5 +1,12 @@ { lib, buildPythonPackage, fetchPypi , django + +, azure-storage-blob +, boto3 +, dropbox +, google-cloud-storage +, libcloud +, paramiko }: buildPythonPackage rec { @@ -13,8 +20,23 @@ buildPythonPackage rec { propagatedBuildInputs = [ django ]; - # django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. - doCheck = false; + preCheck = '' + export DJANGO_SETTINGS_MODULE=tests.settings + # timezone issues https://github.com/jschneier/django-storages/issues/1171 + substituteInPlace tests/test_sftp.py \ + --replace 'test_accessed_time' 'dont_test_accessed_time' \ + --replace 'test_modified_time' 'dont_test_modified_time' + ''; + checkInputs = [ + azure-storage-blob + boto3 + dropbox + google-cloud-storage + libcloud + paramiko + ]; + + pythonImportsCheck = [ "storages" ]; meta = with lib; { description = "Collection of custom storage backends for Django";