Skip to content

Commit

Permalink
Fix oauth2 failure testing
Browse files Browse the repository at this point in the history
Updated `oauthlib` now returns a 400 error instead of 401 for invalid grants (ref: oauthlib/oauthlib#264).
For our purposes, we don't care which type of error it is as long as it is a definitive error.
  • Loading branch information
ushkarev committed Nov 10, 2021
1 parent 53bab93 commit 9db90f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mtp_api/apps/mtp_auth/tests/test_views.py
Expand Up @@ -1796,7 +1796,7 @@ def fail_login(self, user, client):
'client_secret': client.client_secret,
}
)
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertIn(response.status_code, [status.HTTP_400_BAD_REQUEST, status.HTTP_401_UNAUTHORIZED])
return response

def test_account_lockout_on_too_many_attempts(self, mock_send_email):
Expand Down

0 comments on commit 9db90f6

Please sign in to comment.