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 = {