12
12
# License for the specific language governing permissions and limitations
13
13
# under the License.
14
14
15
- from pytest import fixture , mark
16
- from supertokens_python import InputAppInfo , SupertokensConfig , init
17
- from supertokens_python .framework .fastapi import get_middleware
18
- from supertokens_python .recipe import emailpassword , session , passwordless
19
15
import json
20
16
21
17
from fastapi import FastAPI
18
+ from pytest import fixture , mark
19
+
20
+ from supertokens_python import InputAppInfo , SupertokensConfig , init
21
+ from supertokens_python .framework .fastapi import get_middleware
22
+ from supertokens_python .recipe import emailpassword , passwordless , session
22
23
from tests .testclient import TestClientWithNoCookieJar as TestClient
23
- from tests .utils import clean_st , reset , setup_st , start_st , sign_up_request
24
+ from tests .utils import clean_st , reset , setup_st , sign_up_request , start_st
24
25
25
26
26
27
def setup_function (_ ):
@@ -61,7 +62,9 @@ async def test_rid_with_session_and_non_existent_api_in_session_recipe_still_hit
61
62
start_st ()
62
63
63
64
response = driver_config_client .post (url = "/auth/signin" , headers = {"rid" : "session" })
64
- assert response .status_code == 400
65
+ assert response .status_code == 200
66
+ dict_response = json .loads (response .text )
67
+ assert dict_response ["status" ] == "FIELD_ERROR"
65
68
66
69
67
70
@mark .asyncio
@@ -84,7 +87,9 @@ async def test_no_rid_with_existent_API_does_not_give_404(
84
87
start_st ()
85
88
86
89
response = driver_config_client .post (url = "/auth/signin" )
87
- assert response .status_code == 400
90
+ assert response .status_code == 200
91
+ dict_response = json .loads (response .text )
92
+ assert dict_response ["status" ] == "FIELD_ERROR"
88
93
89
94
90
95
@mark .asyncio
@@ -109,7 +114,9 @@ async def test_rid_as_anticsrf_with_existent_API_does_not_give_404(
109
114
response = driver_config_client .post (
110
115
url = "/auth/signin" , headers = {"rid" : "anti-csrf" }
111
116
)
112
- assert response .status_code == 400
117
+ assert response .status_code == 200
118
+ dict_response = json .loads (response .text )
119
+ assert dict_response ["status" ] == "FIELD_ERROR"
113
120
114
121
115
122
@mark .asyncio
@@ -132,7 +139,9 @@ async def test_random_rid_with_existent_API_does_hits_api(
132
139
start_st ()
133
140
134
141
response = driver_config_client .post (url = "/auth/signin" , headers = {"rid" : "random" })
135
- assert response .status_code == 400
142
+ assert response .status_code == 200
143
+ dict_response = json .loads (response .text )
144
+ assert dict_response ["status" ] == "FIELD_ERROR"
136
145
137
146
138
147
@mark .asyncio
0 commit comments