|
8 | 8 | import sqlalchemy |
9 | 9 | from sqlalchemy.ext.asyncio import AsyncSession |
10 | 10 |
|
11 | | -from auth.crud import create_user_session |
| 11 | +from auth.crud import create_user_session, update_site_user |
12 | 12 | from database import SQLALCHEMY_TEST_DATABASE_URL, Base, DatabaseSessionManager |
13 | 13 | from officers.constants import OfficerPosition |
14 | 14 | from officers.crud import create_new_officer_info, create_new_officer_term, update_officer_info, update_officer_term |
@@ -57,8 +57,9 @@ async def reset_db(engine): |
57 | 57 | else: |
58 | 58 | print(f"new tables: {table_list}") |
59 | 59 |
|
60 | | -async def load_test_auth_data(): |
61 | | - pass |
| 60 | +async def load_test_auth_data(db_session: AsyncSession): |
| 61 | + await create_user_session(db_session, "temp_id_314", "abc314") |
| 62 | + await update_site_user(db_session, "temp_id_314", "www.my_profile_picture_url.ca/test") |
62 | 63 |
|
63 | 64 | async def load_test_officers_data(db_session: AsyncSession): |
64 | 65 | print("login the 3 users, putting them in the site users table") |
@@ -216,7 +217,7 @@ async def load_sysadmin(db_session: AsyncSession): |
216 | 217 | # put your computing id here for testing purposes |
217 | 218 | SYSADMIN_COMPUTING_ID = "gsa92" |
218 | 219 |
|
219 | | - await create_user_session(db_session, "temp_id_4", "gsa92") |
| 220 | + await create_user_session(db_session, "temp_id_4", SYSADMIN_COMPUTING_ID) |
220 | 221 | await create_new_officer_info(db_session, OfficerInfo( |
221 | 222 | legal_name="Gabe Schulz", |
222 | 223 | discord_id=None, |
@@ -250,7 +251,7 @@ async def load_sysadmin(db_session: AsyncSession): |
250 | 251 | async def async_main(sessionmanager): |
251 | 252 | await reset_db(sessionmanager._engine) |
252 | 253 | async with sessionmanager.session() as db_session: |
253 | | - # load_test_auth_data |
| 254 | + await load_test_auth_data(db_session) |
254 | 255 | await load_test_officers_data(db_session) |
255 | 256 | await load_sysadmin(db_session) |
256 | 257 |
|
|
0 commit comments