Repository: jazzband/django-axes
Pull request #1081 (2023-06-21 12:57:06)

chore(deps): bump mypy from 1.3.0 to 1.4.0
Bumps [mypy](https://github.com/python/mypy) from 1.3.0 to 1.4.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/python/mypy/commit/be5f84b853d15bbbdd3185349fa8e285f7e19bf3"><code>be5f84b</code></a> Remove +dev from version.</li>
<li><a href="https://github.com/python/mypy/commit/d61383eef28aeef5aa4549e9fd53fb4acc0a4855"><code>d61383e</code></a> Always allow returning Any from lambda (<a href="https://redirect.github.com/python/mypy/issues/15413">#15413</a>)</li>
<li><a href="https://github.com/python/mypy/commit/fa05ab97eae4922e392f5adda1dc51e2ad4e7a0c"><code>fa05ab9</code></a> Fix crash on follow_imports_for_stubs (<a href="https://redirect.github.com/python/mypy/issues/15407">#15407</a>)</li>
<li><a href="https://github.com/python/mypy/commit/cec31d67669c6c5ac907d40466892341a3f49933"><code>cec31d6</code></a> Fix stubtest crash in explicit init subclass (<a href="https://redirect.github.com/python/mypy/issues/15399">#15399</a>)</li>
<li><a href="https://github.com/python/mypy/commit/7886503525819d36df2c440f8c4b03f9c66a38ae"><code>7886503</code></a> Fix crash when indexing TypedDict with empty key (<a href="https://redirect.github.com/python/mypy/issues/15392">#15392</a>)</li>
<li><a href="https://github.com/python/mypy/commit/5e6e488e76c1970aa0a13bee264ee85cf73e97b4"><code>5e6e488</code></a> Fix crash on NamedTuple as attribute (<a href="https://redirect.github.com/python/mypy/issues/15404">#15404</a>)</li>
<li><a href="https://github.com/python/mypy/commit/9caf0959b81db108fffed1423c926f83148ec293"><code>9caf095</code></a> Correctly track loop depth for nested functions/classes (<a href="https://redirect.github.com/python/mypy/issues/15403">#15403</a>)</li>
<li><a href="https://github.com/python/mypy/commit/a7f52db0e69db0bd7d97e548c9b69667a143a451"><code>a7f52db</code></a> Fix crash on joins with recursive tuples (<a href="https://redirect.github.com/python/mypy/issues/15402">#15402</a>)</li>
<li><a href="https://github.com/python/mypy/commit/3bf9fdc347ff1d27baead7660442d645a77cb2c6"><code>3bf9fdc</code></a> Revert &quot;Add support for <code>attrs.fields</code> (<a href="https://redirect.github.com/python/mypy/issues/15021">#15021</a>)&quot;</li>
<li><a href="https://github.com/python/mypy/commit/2ab8849f6460fe586a1a1add3a006ce4edd3fb75"><code>2ab8849</code></a> Update semantic analyzer for TypeVar defaults (PEP 696) (<a href="https://redirect.github.com/python/mypy/issues/14873">#14873</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/python/mypy/compare/v1.3.0...v1.4.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mypy&package-manager=pip&previous-version=1.3.0&new-version=1.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/axes/backends.py b/axes/backends.py
index 6cec9b5..2cec578 100644
--- a/axes/backends.py
+++ b/axes/backends.py
@@ -1,6 +1,6 @@
 from typing import Optional
 from django.conf import settings
-from django.contrib.auth.backends import BaseBackend, ModelBackend
+from django.contrib.auth.backends import ModelBackend
 from django.http import HttpRequest
 
 from axes.exceptions import (
@@ -11,7 +11,7 @@ from axes.handlers.proxy import AxesProxyHandler
 from axes.helpers import get_credentials, get_lockout_message, toggleable
 
 
-class AxesStandaloneBackend(BaseBackend):
+class AxesStandaloneBackend:
     """
     Authentication backend class that forbids login attempts for locked out users.
 
diff --git a/requirements-qa.txt b/requirements-qa.txt
index d4b73dc..2976384 100644
--- a/requirements-qa.txt
+++ b/requirements-qa.txt
@@ -1,4 +1,4 @@
 black==23.3.0
-mypy==1.3.0
+mypy==1.4.0
 prospector==1.10.2
 types-pkg_resources  # Type stub


Test patch:
diff --git a/tests/test_login.py b/tests/test_login.py
index 1caf0ad..80b602f 100644
--- a/tests/test_login.py
+++ b/tests/test_login.py
@@ -28,7 +28,7 @@ class DjangoLoginTestCase(TestCase):
         self.username = "john.doe"
         self.password = "hunter2"
 
-        self.user = get_user_model().objects.create(username=self.username)
+        self.user = get_user_model().objects.create(username=self.username, is_staff=True)
         self.user.set_password(self.password)
         self.user.save()
         self.user.backend = "django.contrib.auth.backends.ModelBackend"
@@ -47,13 +47,19 @@ class DjangoContribAuthLoginTestCase(DjangoLoginTestCase):
 class DjangoTestClientLoginTestCase(DjangoLoginTestCase):
     def test_client_login(self):
         self.client.login(username=self.username, password=self.password)
+        response = self.client.get(reverse("admin:index"))
+        self.assertEqual(response.status_code, 200)
 
     def test_client_logout(self):
         self.client.login(username=self.username, password=self.password)
         self.client.logout()
+        response = self.client.get(reverse("admin:index"))
+        self.assertEqual(response.status_code, 302)
 
     def test_client_force_login(self):
         self.client.force_login(self.user)
+        response = self.client.get(reverse("admin:index"))
+        self.assertEqual(response.status_code, 200)
 
 
 class DatabaseLoginTestCase(AxesTestCase):
@@ -283,7 +289,7 @@ class DatabaseLoginTestCase(AxesTestCase):
         # Test he is locked by user_agent:
         response = self._login("username2", self.VALID_PASSWORD, ip_addr=self.IP_2, user_agent="test-browser")
         self.assertEqual(response.status_code, self.BLOCKED)
-       
+
         # Test he is allowed to login with different username, ip and user_agent
         response = self._login("username2", self.VALID_PASSWORD, ip_addr=self.IP_2, user_agent="test-browser2")
         self.assertEqual(response.status_code, self.ATTEMPT_NOT_BLOCKED)
@@ -308,7 +314,7 @@ class DatabaseLoginTestCase(AxesTestCase):
         # Test he is allowed to login with different user_agent:
         response = self._login("username", self.VALID_PASSWORD, ip_addr=self.IP_1, user_agent="test-browser2")
         self.assertEqual(response.status_code, self.ATTEMPT_NOT_BLOCKED)
-       
+
         # Test he is allowed to login with different username, ip and user_agent
         response = self._login("username2", self.VALID_PASSWORD, ip_addr=self.IP_2, user_agent="test-browser2")
         self.assertEqual(response.status_code, self.ATTEMPT_NOT_BLOCKED)