From 7282a9461e5183e7141cb7fcd2be9ed89ea1dca9 Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Fri, 17 Jan 2025 16:37:39 -0500 Subject: [PATCH] fix: apply no_user_creation for AccessDenied --- auth_oauth_multi_token/tests/test_multi_token.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/auth_oauth_multi_token/tests/test_multi_token.py b/auth_oauth_multi_token/tests/test_multi_token.py index b70fdb4731..1256b6d99b 100644 --- a/auth_oauth_multi_token/tests/test_multi_token.py +++ b/auth_oauth_multi_token/tests/test_multi_token.py @@ -38,14 +38,11 @@ def test_no_provider_no_access(self): "user_id": "oauth_uid_no_one", } params = self._fake_params() - try: - with self.assertRaises(exceptions.AccessDenied): - self.user_model._auth_oauth_signin( - self.provider_google.id, validation, params - ) - # In version 18.0 AccessDenied exception is raising ValueError exception - except ValueError as e: - self.assertEqual(str(e), "Unknown token version") + + with self.assertRaises(exceptions.AccessErrorAccessDenied): + self.user_model.with_context( + **{"no_user_creation": True} + )._auth_oauth_signin(self.provider_google.id, validation, params) def _test_one_token(self): validation = {