Skip to content

Commit 0f8f60a

Browse files
committed
fix: Linter errors in tests after multitenancy
1 parent a8a82a8 commit 0f8f60a

File tree

40 files changed

+1221
-590
lines changed

40 files changed

+1221
-590
lines changed

supertokens_python/recipe/emailpassword/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from supertokens_python.ingredients.emaildelivery.types import EmailDeliveryConfig
1919
from supertokens_python.recipe.emailpassword.types import EmailTemplateVars
20+
from supertokens_python.ingredients.emaildelivery import types as emaildelivery_types
2021

2122
from . import exceptions as ex
2223
from . import utils
@@ -28,6 +29,7 @@
2829
InputSignUpFeature = utils.InputSignUpFeature
2930
InputFormField = utils.InputFormField
3031
SMTPService = emaildelivery_services.SMTPService
32+
EmailDeliveryInterface = emaildelivery_types.EmailDeliveryInterface
3133

3234
if TYPE_CHECKING:
3335
from supertokens_python.supertokens import AppInfo

supertokens_python/recipe/emailverification/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from . import utils
2020
from .emaildelivery import services as emaildelivery_services
2121
from . import recipe
22+
from . import types
2223
from .interfaces import TypeGetEmailForUserIdFunction
2324
from .recipe import EmailVerificationRecipe
2425
from .types import EmailTemplateVars
@@ -28,6 +29,7 @@
2829
exception = ex
2930
SMTPService = emaildelivery_services.SMTPService
3031
EmailVerificationClaim = recipe.EmailVerificationClaim
32+
EmailDeliveryInterface = types.EmailDeliveryInterface
3133

3234

3335
if TYPE_CHECKING:

supertokens_python/recipe/passwordless/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
SMTPService = emaildelivery_services.SMTPService
4848
TwilioService = smsdelivery_services.TwilioService
4949
SuperTokensSMSService = smsdelivery_services.SuperTokensSMSService
50+
EmailDeliveryInterface = types.EmailDeliveryInterface
51+
SMSDeliveryInterface = types.SMSDeliveryInterface
5052

5153

5254
def init(

supertokens_python/recipe/thirdpartyemailpassword/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
from supertokens_python.ingredients.emaildelivery.types import EmailDeliveryConfig
1919
from supertokens_python.recipe.thirdparty import provider
2020
from supertokens_python.recipe.thirdpartyemailpassword.types import EmailTemplateVars
21+
from supertokens_python.ingredients.emaildelivery import types as emaildelivery_types
22+
from . import types
2123

2224
from .. import emailpassword
2325
from . import exceptions as ex
@@ -34,6 +36,9 @@
3436
ProviderConfigForClientType = provider.ProviderConfigForClientType
3537
SMTPService = emaildelivery_services.SMTPService
3638

39+
EmailDeliveryInterface = emaildelivery_types.EmailDeliveryInterface
40+
PasswordResetEmailTemplateVars = types.PasswordResetEmailTemplateVars
41+
3742
if TYPE_CHECKING:
3843
from supertokens_python.supertokens import AppInfo
3944

supertokens_python/recipe/thirdpartypasswordless/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
from .recipe import ThirdPartyPasswordlessRecipe
2828
from .smsdelivery import services as smsdelivery_services
2929
from .types import EmailTemplateVars, SMSTemplateVars
30+
from supertokens_python.ingredients.emaildelivery import types as emaildelivery_types
31+
from supertokens_python.ingredients.smsdelivery import types as smsdelivery_types
3032

3133
InputOverrideConfig = utils.InputOverrideConfig
3234
exceptions = ex
@@ -42,6 +44,8 @@
4244
ProviderConfig = provider.ProviderConfig
4345
ProviderClientConfig = provider.ProviderClientConfig
4446
ProviderConfigForClientType = provider.ProviderConfigForClientType
47+
EmailDeliveryInterface = emaildelivery_types.EmailDeliveryInterface
48+
SMSDeliveryInterface = smsdelivery_types.SMSDeliveryInterface
4549

4650
if TYPE_CHECKING:
4751
from supertokens_python.supertokens import AppInfo

tests/Django/test_django.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,15 @@ def override_email_password_apis(original_implementation: APIInterface):
343343
original_func = original_implementation.email_exists_get
344344

345345
async def email_exists_get(
346-
email: str, api_options: APIOptions, user_context: Dict[str, Any]
346+
email: str,
347+
tenant_id: str,
348+
api_options: APIOptions,
349+
user_context: Dict[str, Any],
347350
):
348351
response_dict = {"custom": True}
349352
api_options.response.set_status_code(203)
350353
api_options.response.set_json_content(response_dict)
351-
return await original_func(email, api_options, user_context)
354+
return await original_func(email, tenant_id, api_options, user_context)
352355

353356
original_implementation.email_exists_get = email_exists_get
354357
return original_implementation

tests/Fastapi/test_fastapi.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,15 @@ def override_email_password_apis(original_implementation: EPAPIInterface):
454454
original_func = original_implementation.email_exists_get
455455

456456
async def email_exists_get(
457-
email: str, api_options: APIOptions, user_context: Dict[str, Any]
457+
email: str,
458+
tenant_id: str,
459+
api_options: APIOptions,
460+
user_context: Dict[str, Any],
458461
):
459462
response_dict = {"custom": True}
460463
api_options.response.set_status_code(203)
461464
api_options.response.set_json_content(response_dict)
462-
return await original_func(email, api_options, user_context)
465+
return await original_func(email, tenant_id, api_options, user_context)
463466

464467
original_implementation.email_exists_get = email_exists_get
465468
return original_implementation

tests/Flask/test_flask.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,15 @@ def override_email_password_apis(original_implementation: APIInterface):
8282
original_func = original_implementation.email_exists_get
8383

8484
async def email_exists_get(
85-
email: str, api_options: APIOptions, user_context: Dict[str, Any]
85+
email: str,
86+
tenant_id: str,
87+
api_options: APIOptions,
88+
user_context: Dict[str, Any],
8689
):
8790
response_dict = {"custom": True}
8891
api_options.response.set_status_code(203)
8992
api_options.response.set_json_content(response_dict)
90-
return await original_func(email, api_options, user_context)
93+
return await original_func(email, tenant_id, api_options, user_context)
9194

9295
original_implementation.email_exists_get = email_exists_get
9396
return original_implementation

0 commit comments

Comments
 (0)