Skip to content

Commit 73ad244

Browse files
committed
test(postgres): add context comments for has admin db tests
1 parent e828a8c commit 73ad244

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

api/tests/integration/postgres/test_postgresusersrepository.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,30 @@ def repository(db_session):
1212
@pytest.mark.asyncio(loop_scope="session")
1313
class TestHasAdminUser:
1414
async def test_returns_false_when_no_users_exist(self, repository, db_session):
15+
# Act
1516
result = await repository.has_admin_user()
1617

18+
# Assert
1719
assert result is False
1820

1921
async def test_returns_true_when_admin_user_exists(self, repository, db_session):
22+
# Arrange
2023
UserSQLFactory(admin_user=True)
2124
await db_session.flush()
2225

26+
# Act
2327
result = await repository.has_admin_user()
2428

29+
# Assert
2530
assert result is True
2631

2732
async def test_returns_false_when_user_exists_without_admin_permission(self, repository, db_session):
33+
# Arrange
2834
UserSQLFactory(regular_user=True)
2935
await db_session.flush()
3036

37+
# Act
3138
result = await repository.has_admin_user()
3239

40+
# Assert
3341
assert result is False

0 commit comments

Comments
 (0)