summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-06-13 09:58:56 +0200
committerMichał Górny <mgorny@gentoo.org>2022-06-13 10:17:10 +0200
commitdff7b951811dde55af59852b78639b458e0539db (patch)
treedbfb15281d8f020403c0601da327ed7b4ced2111 /dev-python/django-configurations
parentdev-python/dj-search-url: Enable py3.11 (diff)
downloadgentoo-dff7b951811dde55af59852b78639b458e0539db.tar.gz
gentoo-dff7b951811dde55af59852b78639b458e0539db.tar.bz2
gentoo-dff7b951811dde55af59852b78639b458e0539db.zip
dev-python/django-configurations: Fix failing tests
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/django-configurations')
-rw-r--r--dev-python/django-configurations/django-configurations-2.3.2.ebuild4
-rw-r--r--dev-python/django-configurations/files/django-configurations-2.3.2-test.patch45
2 files changed, 49 insertions, 0 deletions
diff --git a/dev-python/django-configurations/django-configurations-2.3.2.ebuild b/dev-python/django-configurations/django-configurations-2.3.2.ebuild
index b8bbfbdabaea..00b555a25889 100644
--- a/dev-python/django-configurations/django-configurations-2.3.2.ebuild
+++ b/dev-python/django-configurations/django-configurations-2.3.2.ebuild
@@ -36,6 +36,10 @@ BDEPEND="
export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
+PATCHES=(
+ "${FILESDIR}"/${P}-test.patch
+)
+
python_test() {
local -x DJANGO_SETTINGS_MODULE=tests.settings.main
local -x DJANGO_CONFIGURATION=Test
diff --git a/dev-python/django-configurations/files/django-configurations-2.3.2-test.patch b/dev-python/django-configurations/files/django-configurations-2.3.2-test.patch
new file mode 100644
index 000000000000..19787102920a
--- /dev/null
+++ b/dev-python/django-configurations/files/django-configurations-2.3.2-test.patch
@@ -0,0 +1,45 @@
+diff --git a/tests/test_values.py b/tests/test_values.py
+index 2547e50..2f1170b 100644
+--- a/tests/test_values.py
++++ b/tests/test_values.py
+@@ -2,6 +2,7 @@ import decimal
+ import os
+ from contextlib import contextmanager
+
++from django import VERSION as DJANGO_VERSION
+ from django.test import TestCase
+ from django.core.exceptions import ImproperlyConfigured
+
+@@ -411,6 +412,7 @@ class ValueTests(TestCase):
+ 'EMAIL_HOST_PASSWORD': 'password',
+ 'EMAIL_HOST_USER': 'user@domain.com',
+ 'EMAIL_PORT': 587,
++ 'EMAIL_TIMEOUT': None,
+ 'EMAIL_USE_SSL': False,
+ 'EMAIL_USE_TLS': True})
+ with env(EMAIL_URL='console://'):
+@@ -421,6 +423,7 @@ class ValueTests(TestCase):
+ 'EMAIL_HOST_PASSWORD': None,
+ 'EMAIL_HOST_USER': None,
+ 'EMAIL_PORT': None,
++ 'EMAIL_TIMEOUT': None,
+ 'EMAIL_USE_SSL': False,
+ 'EMAIL_USE_TLS': False})
+ with env(EMAIL_URL='smtps://user@domain.com:password@smtp.example.com:wrong'): # noqa: E501
+@@ -429,7 +432,7 @@ class ValueTests(TestCase):
+ def test_cache_url_value(self):
+ cache_setting = {
+ 'default': {
+- 'BACKEND': 'django_redis.cache.RedisCache',
++ 'BACKEND': 'django_redis.cache.RedisCache' if DJANGO_VERSION[0] < 4 else 'django.core.cache.backends.redis.RedisCache',
+ 'LOCATION': 'redis://host:6379/1',
+ }
+ }
+@@ -503,6 +506,7 @@ class ValueTests(TestCase):
+ 'EMAIL_HOST_PASSWORD': 'password',
+ 'EMAIL_HOST_USER': 'user@domain.com',
+ 'EMAIL_PORT': 587,
++ 'EMAIL_TIMEOUT': None,
+ 'EMAIL_USE_SSL': False,
+ 'EMAIL_USE_TLS': True
+ })