Skip to content

Commit 9eb50a5

Browse files
committed
test: Fix failing tests for django and flask
1 parent 13ba9b9 commit 9eb50a5

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tests/auth-react/django3x/mysite/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
thirdparty,
1313
thirdpartyemailpassword,
1414
thirdpartypasswordless,
15+
userroles,
1516
)
1617
from supertokens_python.recipe.emailpassword import EmailPasswordRecipe
1718
from supertokens_python.recipe.emailpassword.interfaces import (
@@ -81,6 +82,7 @@
8182
from supertokens_python.recipe.thirdpartypasswordless.interfaces import (
8283
APIInterface as ThirdpartyPasswordlessAPIInterface,
8384
)
85+
from supertokens_python.recipe.userroles import UserRolesRecipe
8486
from supertokens_python.types import GeneralErrorResponse
8587
from typing_extensions import Literal
8688

@@ -240,13 +242,15 @@ def custom_init(
240242
None, Literal["USER_INPUT_CODE", "MAGIC_LINK", "USER_INPUT_CODE_AND_MAGIC_LINK"]
241243
] = None,
242244
):
245+
UserRolesRecipe.reset()
243246
PasswordlessRecipe.reset()
244247
ThirdPartyPasswordlessRecipe.reset()
245248
JWTRecipe.reset()
246249
EmailVerificationRecipe.reset()
247250
SessionRecipe.reset()
248251
ThirdPartyRecipe.reset()
249252
EmailPasswordRecipe.reset()
253+
EmailVerificationRecipe.reset()
250254
ThirdPartyEmailPasswordRecipe.reset()
251255
Supertokens.reset()
252256

@@ -849,6 +853,7 @@ async def authorisation_url_get(
849853
)
850854

851855
recipe_list = [
856+
userroles.init(),
852857
session.init(override=session.InputOverrideConfig(apis=override_session_apis)),
853858
emailverification.init(
854859
mode="OPTIONAL",

tests/auth-react/flask-server/app.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
thirdparty,
3636
thirdpartyemailpassword,
3737
thirdpartypasswordless,
38+
userroles,
3839
)
3940
from supertokens_python.recipe.emailpassword import EmailPasswordRecipe
4041
from supertokens_python.recipe.emailpassword.interfaces import (
@@ -111,7 +112,11 @@
111112
from supertokens_python.recipe.thirdpartypasswordless.interfaces import (
112113
APIInterface as ThirdpartyPasswordlessAPIInterface,
113114
)
114-
from supertokens_python.recipe.userroles import UserRoleClaim, PermissionClaim
115+
from supertokens_python.recipe.userroles import (
116+
UserRoleClaim,
117+
PermissionClaim,
118+
UserRolesRecipe,
119+
)
115120
from supertokens_python.recipe.userroles.asyncio import (
116121
create_new_role_or_add_permissions,
117122
add_role_to_user,
@@ -275,13 +280,15 @@ def custom_init(
275280
None, Literal["USER_INPUT_CODE", "MAGIC_LINK", "USER_INPUT_CODE_AND_MAGIC_LINK"]
276281
] = None,
277282
):
283+
UserRolesRecipe.reset()
278284
PasswordlessRecipe.reset()
279285
ThirdPartyPasswordlessRecipe.reset()
280286
JWTRecipe.reset()
281287
EmailVerificationRecipe.reset()
282288
SessionRecipe.reset()
283289
ThirdPartyRecipe.reset()
284290
EmailPasswordRecipe.reset()
291+
EmailVerificationRecipe.reset()
285292
ThirdPartyEmailPasswordRecipe.reset()
286293
Supertokens.reset()
287294

@@ -904,6 +911,7 @@ async def authorisation_url_get(
904911
)
905912

906913
recipe_list = [
914+
userroles.init(),
907915
session.init(override=session.InputOverrideConfig(apis=override_session_apis)),
908916
emailverification.init(
909917
mode="OPTIONAL",

0 commit comments

Comments
 (0)