Skip to content

Commit 2302860

Browse files
committed
Made more fixes for the deploy tests
1 parent 16d344d commit 2302860

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
POSTGRES_PASSWORD: postgres
4949
POSTGRES_DB: test_db
5050
SECRET_KEY: test-secret-key-for-testing
51-
FIRST_SUPERUSER: test@example.com
51+
FIRST_SUPERUSER: admin@example.com
5252
FIRST_SUPERUSER_PASSWORD: testpassword
5353
ENVIRONMENT: local
5454
run: |
@@ -64,7 +64,7 @@ jobs:
6464
POSTGRES_PASSWORD: postgres
6565
POSTGRES_DB: test_db
6666
SECRET_KEY: test-secret-key-for-testing
67-
FIRST_SUPERUSER: test@example.com
67+
FIRST_SUPERUSER: admin@example.com
6868
FIRST_SUPERUSER_PASSWORD: testpassword
6969
ENVIRONMENT: local
7070
run: |

backend/tests/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from app.core.config import settings
88
from app.core.db import engine, init_db
99
from app.main import app
10-
from app.models import Item, User
10+
from app.models import Item, Organization, User
1111
from tests.utils.user import authentication_token_from_email
1212
from tests.utils.utils import get_superuser_token_headers
1313

@@ -17,10 +17,13 @@ def db() -> Generator[Session, None, None]:
1717
with Session(engine) as session:
1818
init_db(session)
1919
yield session
20+
# Clean up in proper order due to foreign key constraints
2021
statement = delete(Item)
2122
session.execute(statement)
2223
statement = delete(User)
2324
session.execute(statement)
25+
statement = delete(Organization)
26+
session.execute(statement)
2427
session.commit()
2528

2629

0 commit comments

Comments
 (0)