Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

test_auth_backends: Add types for subclass fields of SocialAuthBase.

Tim Abbott9aca1dffcdaa
diff --git a/zerver/tests/test_auth_backends.py b/zerver/tests/test_auth_backends.py
index d943605a596..5e55d36238c 100644
--- a/zerver/tests/test_auth_backends.py
+++ b/zerver/tests/test_auth_backends.py
@@ -7,7 +7,7 @@ import secrets
import time
import urllib
from contextlib import contextmanager
-from typing import Any, Callable, Dict, Iterator, List, Mapping, Optional, Sequence, Tuple
+from typing import Any, Callable, Dict, Iterator, List, Mapping, Optional, Sequence, Tuple, Type
from unittest import mock
import jwt
@@ -800,6 +800,21 @@ class SocialAuthBase(DesktopFlowTestingLib, ZulipTestCase):
# in subclass otherwise its tests will not run.
__unittest_skip__ = True
+ BACKEND_CLASS: "Type[SocialAuthMixin]"
+ LOGIN_URL: str
+ SIGNUP_URL: str
+ AUTHORIZATION_URL: str
+ AUTH_FINISH_URL: str
+ CONFIG_ERROR_URL: str
+ ACCESS_TOKEN_URL: str
+ USER_INFO_URL: str
+ CLIENT_KEY_SETTING: str
+ CLIENT_SECRET_SETTING: str
+
+ # Functions that subclasses must implement.
+ def get_account_data_dict(self, email: str, name: str) -> Dict[str, Any]:
+ ...
+
def setUp(self) -> None:
super().setUp()
self.user_profile = self.example_user("hamlet")