refactor: make mock_enqueue_job fixture opt-in instead of autouse
Tests that call POST /api/counter/increment now explicitly request the mock_enqueue_job fixture. This prevents the mock from masking issues in other tests that don't need it.
This commit is contained in:
parent
6f3e729b25
commit
4d9edd7fd4
3 changed files with 10 additions and 8 deletions
|
|
@ -104,7 +104,7 @@ class TestCounterAccess:
|
|||
|
||||
@pytest.mark.asyncio
|
||||
async def test_regular_user_can_increment_counter(
|
||||
self, client_factory, regular_user
|
||||
self, client_factory, regular_user, mock_enqueue_job
|
||||
):
|
||||
async with client_factory.create(cookies=regular_user["cookies"]) as client:
|
||||
response = await client.post("/api/counter/increment")
|
||||
|
|
@ -484,7 +484,7 @@ class TestAuditRecords:
|
|||
|
||||
@pytest.mark.asyncio
|
||||
async def test_counter_increment_creates_audit_record(
|
||||
self, client_factory, regular_user, admin_user
|
||||
self, client_factory, regular_user, admin_user, mock_enqueue_job
|
||||
):
|
||||
"""Verify that counter increments are recorded and visible in audit."""
|
||||
# Regular user increments counter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue