Skip to content

Commit

Permalink
cleanup database
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Sep 27, 2021
1 parent 74bcd9e commit 95835f8
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import pytest
import sqlalchemy as sa
from aiohttp import web
from faker import Faker
from pytest_simcore.helpers.utils_assert import assert_error, assert_status
Expand Down Expand Up @@ -138,6 +139,13 @@ async def test_registration_with_confirmation(
await db.delete_user(user)


@pytest.fixture()
def clean_users_table(postgres_db: sa.engine.Engine) -> None:
yield

postgres_db.execute("TRUNCATE users CASCADE")


@pytest.mark.parametrize(
"is_invitation_required,has_valid_invitation,expected_response",
[
Expand All @@ -153,6 +161,7 @@ async def test_registration_with_invitation(
has_valid_invitation,
expected_response,
faker: Faker,
clean_users_table,
):
from servicelib.aiohttp.application_keys import APP_CONFIG_KEY
from simcore_service_webserver.login.config import CONFIG_SECTION_NAME
Expand Down

0 comments on commit 95835f8

Please sign in to comment.