Skip to content

Commit

Permalink
add test case for user does not exist in LoginFieldBackend
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwojcik committed Jun 7, 2024
1 parent bc21dcf commit 81cd1e2
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,17 @@ def test_failing_login(
send_field,
user_can_authenticate,
)

def test_user_does_not_exist(self, client, settings, mocker):
self.configure_djoser_settings(
settings=settings,
mocker=mocker,
login_field="username",
username_field="username",
user_can_authenticate=True,
)
data = {"username": "idontexist1337", "password": "P455W0RD"}

response = client.post(self.url, data)

assert response.status_code == status.HTTP_400_BAD_REQUEST

0 comments on commit 81cd1e2

Please sign in to comment.