Skip to content

Commit

Permalink
Upgrade version to 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
llybin committed May 11, 2024
1 parent 683bdad commit 91df239
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
10 changes: 3 additions & 7 deletions tests/test_checks.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
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


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):
Expand Down

0 comments on commit 91df239

Please sign in to comment.