Skip to content

Commit

Permalink
Fix failing tests to work with Django (4.0) main dev branch
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanWillitts authored and kencochrane committed Apr 29, 2021
1 parent d413e60 commit 5f5b34d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changes
=======

Unreleased
----------

* Fix failing tests for Django main development branch (Django 4.0)

0.9.0
-----

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ There's sample ``BasicAuthenticationDefender`` class based on ``djangorestframew
import base64
import binascii
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from rest_framework import HTTP_HEADER_ENCODING, exceptions
from rest_framework.authentication import (
Expand Down
4 changes: 2 additions & 2 deletions defender/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.conf import settings
from django.utils.translation import ugettext_lazy
from django.utils.translation import gettext_lazy


def get_setting(variable, default=None):
Expand Down Expand Up @@ -61,7 +61,7 @@ def get_setting(variable, default=None):

LOCKOUT_TEMPLATE = get_setting("DEFENDER_LOCKOUT_TEMPLATE")

ERROR_MESSAGE = ugettext_lazy(
ERROR_MESSAGE = gettext_lazy(
"Please enter a correct username and password. "
"Note that both fields are case-sensitive."
)
Expand Down
8 changes: 4 additions & 4 deletions defender/signals.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from django.dispatch import Signal

username_block = Signal(providing_args=["username"])
username_unblock = Signal(providing_args=["username"])
ip_block = Signal(providing_args=["ip_address"])
ip_unblock = Signal(providing_args=["ip_address"])
username_block = Signal() # (providing_args=["username"])
username_unblock = Signal() # (providing_args=["username"])
ip_block = Signal() # (providing_args=["ip_address"])
ip_unblock = Signal() # (providing_args=["ip_address"])


class BlockSignal:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
# list of supported Django/Python versioons:
# list of supported Django/Python versions:
py{36,37,38,39,py3}-dj{22,31,32}
py{38,39}-djmain
py38-{lint,docs}
Expand Down

0 comments on commit 5f5b34d

Please sign in to comment.