diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f74b04a..0720acb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,8 +10,8 @@ jobs: fail-fast: false matrix: python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] - django-version: [ "3.2", "4.0", "4.1", "4.2" ] - drf-version: [ "3.11", "3.12", "3.13", "3.14" ] + django-version: [ "3.2", "4.0", "4.1", "4.2", "5.0"] + drf-version: [ "3.11", "3.12", "3.13", "3.14", "3.15" ] exclude: # https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django - django-version: "4.0" @@ -20,6 +20,12 @@ jobs: python-version: "3.7" - django-version: "4.2" python-version: "3.7" + - django-version: "5.0" + python-version: "3.7" + - django-version: "4.2" + python-version: "3.8" + - django-version: "4.2" + python-version: "3.9" # https://www.django-rest-framework.org/community/release-notes/ - django-version: "4.2" drf-version: "3.11" @@ -28,9 +34,9 @@ jobs: - django-version: "4.2" drf-version: "3.13" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies 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):