Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

fix websocket test cases

jonaswinkler8711a206a0eb
diff --git a/src/paperless/tests/test_websockets.py b/src/paperless/tests/test_websockets.py
index e5745ce77..4f98fe2b5 100644
--- a/src/paperless/tests/test_websockets.py
+++ b/src/paperless/tests/test_websockets.py
@@ -8,14 +8,16 @@ from paperless.asgi import application
class TestWebSockets(TestCase):
- async def test_no_auth(self):
+ @mock.patch("paperless.consumers.async_to_sync")
+ async def test_no_auth(self, async_to_sync):
communicator = WebsocketCommunicator(application, "/ws/status/")
connected, subprotocol = await communicator.connect()
self.assertFalse(connected)
await communicator.disconnect()
+ @mock.patch("paperless.consumers.async_to_sync")
@mock.patch("paperless.consumers.StatusConsumer._authenticated")
- async def test_auth(self, _authenticated):
+ async def test_auth(self, _authenticated, async_to_sync):
_authenticated.return_value = True
communicator = WebsocketCommunicator(application, "/ws/status/")