diff --git a/SAS/TMSS/backend/services/websocket/test/t_websocket_service.py b/SAS/TMSS/backend/services/websocket/test/t_websocket_service.py index 286ad13379f3ba68130a74c5a83a65c30ef166ab..23657a578fbc2ab5a3384aab2a14f8a5e29fe9bb 100755 --- a/SAS/TMSS/backend/services/websocket/test/t_websocket_service.py +++ b/SAS/TMSS/backend/services/websocket/test/t_websocket_service.py @@ -25,7 +25,6 @@ logger = logging.getLogger('lofar.' + __name__) logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO) from lofar.sas.tmss.test.test_environment import TMSSTestEnvironment -from lofar.sas.tmss.test.tmss_test_environment_unittest_setup import AUTH, BASE_URL from lofar.messaging.messagebus import TemporaryExchange, BusListenerJanitor from lofar.sas.tmss.services.websocket_service import create_service, TMSSEventMessageHandlerForWebsocket, DEFAULT_WEBSOCKET_PORT @@ -68,7 +67,9 @@ class TestSubtaskSchedulingService(unittest.TestCase): def on_open(ws): logger.info('Connected to ws') # Send auth token as first message after the WS handshake - response = requests.post(BASE_URL + '/token-auth/', json={'username': AUTH.username, 'password': AUTH.password}) + response = requests.post(self.test_data_creator.django_api_url + '/token-auth/', + json={'username': self.tmss_test_env.client_credentials.dbcreds.user, + 'password': self.tmss_test_env.client_credentials.dbcreds.password}) ws.send(JSONdumps(response.json())) def on_close(ws):