From 9cb78c9670827e54255835551b48ba4794b9e056 Mon Sep 17 00:00:00 2001 From: Toni000 Date: Mon, 25 Mar 2024 15:58:36 +0100 Subject: [PATCH] #108 backend: fix test --- .../game/tests/test_websocket_authentication.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/dps_training_k/game/tests/test_websocket_authentication.py b/backend/dps_training_k/game/tests/test_websocket_authentication.py index e158e425..df9e6089 100644 --- a/backend/dps_training_k/game/tests/test_websocket_authentication.py +++ b/backend/dps_training_k/game/tests/test_websocket_authentication.py @@ -1,5 +1,6 @@ from django.test import TransactionTestCase from game.models import User +from .factories import PatientFactory from rest_framework.authtoken.models import Token from configuration.asgi import application from channels.testing import WebsocketCommunicator @@ -9,8 +10,9 @@ class PatientWebSocketTest(TransactionTestCase): def setUp(self): super().setUp() # Create a user and token for testing - self.user = User.objects.create_user(username="testpatient123", password="test") + self.user = User.objects.create_user(username="123456", password="test") self.token, _ = Token.objects.get_or_create(user=self.user) + self.patient = PatientFactory() async def test_authenticated_websocket_connection(self): # Connect to the WebSocket