Skip to content
Snippets Groups Projects
Commit ee4c04f5 authored by Mario Raciti's avatar Mario Raciti
Browse files

TMSS-556: Fix parameters for auth token retrieval in t_websocket_service test

parent 02006cbb
Branches
Tags
1 merge request!822Resolve TMSS-556
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment