Skip to content

Commit 59e1a46

Browse files
Merge pull request #201 from supertokens/ci/fix-django2x-frontend-integration
ci: Fix failing unit and django2x frontend integration tests
2 parents aa4bc27 + 9500c49 commit 59e1a46

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

.circleci/config_continue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
6969
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
7070
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
71-
- run: make with-django
71+
- run: make with-django2x
7272
- run: (cd .circleci/ && ./websiteDjango2x.sh)
7373
- slack/status
7474
test-authreact-fastapi:

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ with-fastapi:
3434
with-django:
3535
pip3 install -e .[django]
3636

37+
with-django2x:
38+
pip3 install -e .[django2x]
39+
3740
with-flask:
3841
pip3 install -e .[flask]
3942

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,20 @@
3131
"django": (
3232
[
3333
"django-cors-headers==3.11.0",
34-
"django",
34+
"django==3",
3535
"django-stubs==1.9.0",
3636
"uvicorn==0.18.2",
3737
"python-dotenv==0.19.2",
3838
]
3939
),
40+
"django2x": (
41+
[
42+
"django-cors-headers==2.0",
43+
"django==2",
44+
"django-stubs==1.9.0",
45+
"python-dotenv==0.19.2",
46+
]
47+
),
4048
}
4149

4250
exclude_list = [

tests/supertokens_python/test_supertokens_functions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
from supertokens_python import InputAppInfo, SupertokensConfig
2121
from supertokens_python import asyncio as st_asyncio
2222
from supertokens_python import init
23+
from supertokens_python.querier import Querier
2324
from supertokens_python.recipe import emailpassword, session
2425
from supertokens_python.recipe.emailpassword import asyncio as ep_asyncio
2526
from supertokens_python.recipe.emailpassword.interfaces import SignUpOkResult
27+
from supertokens_python.utils import is_version_gte
2628

2729

2830
def setup_function(_):
@@ -71,6 +73,11 @@ async def test_supertokens_functions():
7173
emails_desc = [user.email for user in users_desc]
7274
assert emails_desc == emails[::-1]
7375

76+
version = await Querier.get_instance().get_api_version()
77+
if not is_version_gte(version, "2.10"):
78+
# If the version is less than 2.10, delete user feature doesn't exist, so mark the test successful
79+
return
80+
7481
# Delete the 2nd user (bar@example.com)
7582
await st_asyncio.delete_user(user_ids[1])
7683

0 commit comments

Comments
 (0)