diff --git a/setup.py b/setup.py index e89d9e8..5600f16 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ def read(f): setup( name="drf-recaptcha", - version="3.0.0", + version="3.1.0", description="Django rest framework recaptcha field serializer.", long_description=read("README.md"), long_description_content_type="text/markdown", @@ -22,7 +22,7 @@ def read(f): "django-ipware>=2.1", ], setup_requires=["pytest-runner"], - tests_require=["pytest", "pytest-django", "pytest-cov", "pytest-mock"], + tests_require=["pytest", "pytest-django", "pytest-cov", "pytest-mock", "pytz"], python_requires=">=3.7", include_package_data=True, zip_safe=False, diff --git a/tests/settings.py b/tests/settings.py index bfbc425..134e6f0 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -8,4 +8,6 @@ "default": {"ENGINE": "django.db.backends.sqlite3", "NAME": "test.sqlite3"} } +USE_TZ = False + DRF_RECAPTCHA_SECRET_KEY = "TEST_DRF_RECAPTCHA_SECRET_KEY" diff --git a/tests/test_checks.py b/tests/test_checks.py index 5e76853..16c8449 100644 --- a/tests/test_checks.py +++ b/tests/test_checks.py @@ -1,6 +1,3 @@ -import pytest -from django.core.exceptions import ImproperlyConfigured - from drf_recaptcha.checks import recaptcha_system_check from drf_recaptcha.constants import TEST_V2_SECRET_KEY @@ -8,10 +5,9 @@ def test_warning_no_secret_key(settings): settings.DRF_RECAPTCHA_SECRET_KEY = None - with pytest.raises(ImproperlyConfigured) as exc_info: - recaptcha_system_check(None) - - assert str(exc_info.value) == "settings.DRF_RECAPTCHA_SECRET_KEY must be set." + errors = recaptcha_system_check(None) + assert len(errors) == 1 + assert errors[0].msg == "settings.DRF_RECAPTCHA_SECRET_KEY must be set." def test_silent_testing(settings):