Skip to content

Commit

Permalink
test: fix test_sign_up_the_same_user_twice_should_throw_an_error test
Browse files Browse the repository at this point in the history
  • Loading branch information
leynier committed Nov 1, 2021
1 parent 21d7bda commit eb86078
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
11 changes: 3 additions & 8 deletions tests/_async/test_client_with_auto_confirm_enabled.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,12 @@ async def test_set_session_should_return_no_error(

@pytest.mark.asyncio
@pytest.mark.depends(on=[test_sign_up.__name__])
async def test_sign_up_the_same_user_twice_should_throw_an_error(
async def test_sign_up_the_same_user_twice_not_should_throw_an_error(
client: AsyncGoTrueClient,
):
expected_error_message = (
"Thanks for registering, now check your email to complete the process."
)
try:
await client.sign_up(email=email, password=password)
assert False
except ApiError as e:
assert e.msg == expected_error_message
response = await client.sign_up(email=email, password=password)
assert isinstance(response, User)
except Exception as e:
assert False, str(e)

Expand Down
11 changes: 3 additions & 8 deletions tests/_sync/test_client_with_auto_confirm_enabled.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,12 @@ def test_set_session_should_return_no_error(

@pytest.mark.asyncio
@pytest.mark.depends(on=[test_sign_up.__name__])
def test_sign_up_the_same_user_twice_should_throw_an_error(
def test_sign_up_the_same_user_twice_not_should_throw_an_error(
client: SyncGoTrueClient,
):
expected_error_message = (
"Thanks for registering, now check your email to complete the process."
)
try:
client.sign_up(email=email, password=password)
assert False
except ApiError as e:
assert e.msg == expected_error_message
response = client.sign_up(email=email, password=password)
assert isinstance(response, User)
except Exception as e:
assert False, str(e)

Expand Down

0 comments on commit eb86078

Please sign in to comment.