diff --git a/tests/unit/test_viral_video_ws.py b/tests/unit/test_viral_video_ws.py index ddd7c28f4..6f04587a4 100644 --- a/tests/unit/test_viral_video_ws.py +++ b/tests/unit/test_viral_video_ws.py @@ -14,7 +14,6 @@ class TestWorkerEmitProgress: def test_publishes_valid_json(self): import redis - from worker_app.tasks.viral_video import _emit_progress fake_r = MagicMock() @@ -91,11 +90,10 @@ class TestWSRejectsUnauthenticated: """WS endpoint must close with 4401 when no token / bad token.""" def _make_client(self): + from app.api.routes.viral_video import router from fastapi import FastAPI from fastapi.testclient import TestClient - from app.api.routes.viral_video import router - app = FastAPI() app.include_router(router) # Patch _ws_authenticate_user to return None (no auth) regardless of token @@ -114,11 +112,10 @@ class TestWSOwnershipAnd404: """WS endpoint must verify the job exists and belongs to the authenticated user.""" def _build_client(self, *, fake_user_id="user-1", fake_job=None): + from app.api.routes import viral_video as vv_module from fastapi import FastAPI from fastapi.testclient import TestClient - from app.api.routes import viral_video as vv_module - app = FastAPI() app.include_router(vv_module.router)