Skip to content

Commit

Permalink
fixes more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Sep 25, 2024
1 parent d604a7f commit 05c1242
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions tests/emailpassword/test_emailverify.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ async def test_the_generate_token_api_with_valid_input_and_then_remove_token(
verify_token = await create_email_verification_token(
"public", RecipeUserId(user_id)
)
await revoke_email_verification_tokens("public", user_id)
await revoke_email_verification_tokens("public", RecipeUserId(user_id))

if isinstance(verify_token, CreateEmailVerificationTokenOkResult):
response = await verify_email_using_token("public", verify_token.token)
Expand Down Expand Up @@ -1175,11 +1175,11 @@ async def test_the_generate_token_api_with_valid_input_verify_and_then_unverify_
if isinstance(verify_token, CreateEmailVerificationTokenOkResult):
await verify_email_using_token("public", verify_token.token)

assert await is_email_verified(user_id)
assert await is_email_verified(RecipeUserId(user_id))

await unverify_email(user_id)
await unverify_email(RecipeUserId(user_id))

is_verified = await is_email_verified(user_id)
is_verified = await is_email_verified(RecipeUserId(user_id))
assert is_verified is False
return
raise Exception("Test failed")
Expand Down Expand Up @@ -1304,10 +1304,10 @@ async def send_email(
)
assert res.status_code == 200
assert res.json() == {"status": "EMAIL_ALREADY_VERIFIED_ERROR"}
assert "front-token" not in res.headers
assert res.headers.get("front-token") is not None

# now we mark the email as unverified and try again:
await unverify_email(user_id)
await unverify_email(RecipeUserId(user_id))
res = email_verify_token_request(
driver_config_client,
cookies["sAccessToken"]["value"],
Expand Down
4 changes: 2 additions & 2 deletions tests/sessions/claims/test_primitive_array_claim.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,13 @@ async def test_validator_excludes_all_should_validate_matching_payload():
async def test_validator_should_not_validate_older_values_with_5min_default_max_age(
patch_get_timestamp_ms: MagicMock,
):
claim = PrimitiveArrayClaim("key", sync_fetch_value, 3000) # 5 mins
claim = PrimitiveArrayClaim("key", sync_fetch_value, 300) # 5 mins
payload = await claim.build(
"user_id", RecipeUserId("user_id"), DEFAULT_TENANT_ID, {}
)

# Increase clock time by 10 MINS:
patch_get_timestamp_ms.return_value += 10 * MINS # type: ignore
patch_get_timestamp_ms.return_value += 10 * MINS

res = await resolve(claim.validators.includes(included_item).validate(payload, {}))
assert res.is_valid is False
Expand Down
2 changes: 1 addition & 1 deletion tests/sessions/claims/test_set_claim_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def test_should_overwrite_claim_value(timestamp: int):

# Payload should be updated now:
payload = s.get_access_token_payload()
assert len(payload) == 10
assert len(payload) == 11
assert payload["st-true"] == {"t": timestamp, "v": False}


Expand Down

0 comments on commit 05c1242

Please sign in to comment.