Skip to content
Snippets Groups Projects
Commit b1f8e86f authored by Auke Klazema's avatar Auke Klazema
Browse files

TMSS-243: Reverse some API urls changes

parent 35cb9285
Branches
Tags
1 merge request!191Resolve TMSS-243
...@@ -53,7 +53,7 @@ class LDAPSession(unittest.TestCase): ...@@ -53,7 +53,7 @@ class LDAPSession(unittest.TestCase):
import time import time
time.sleep(20) time.sleep(20)
session.verify = False session.verify = False
r = session.get(BASE_URL + 'task_draft/?format=api') r = session.get(BASE_URL + '/task_draft/?format=api')
self.assertEqual(r.status_code, 401) self.assertEqual(r.status_code, 401)
self.assertTrue("Authentication credentials were not provided" in r.content.decode('utf8')) self.assertTrue("Authentication credentials were not provided" in r.content.decode('utf8'))
...@@ -61,7 +61,7 @@ class LDAPSession(unittest.TestCase): ...@@ -61,7 +61,7 @@ class LDAPSession(unittest.TestCase):
with requests.Session() as session: with requests.Session() as session:
session.verify = False session.verify = False
session.auth = (AUTH.username, 'wrong') session.auth = (AUTH.username, 'wrong')
r = session.get(BASE_URL + 'task_draft/?format=api') r = session.get(BASE_URL + '/task_draft/?format=api')
self.assertEqual(r.status_code, 401) self.assertEqual(r.status_code, 401)
self.assertTrue("Invalid username/password" in r.content.decode('utf8')) self.assertTrue("Invalid username/password" in r.content.decode('utf8'))
...@@ -69,7 +69,7 @@ class LDAPSession(unittest.TestCase): ...@@ -69,7 +69,7 @@ class LDAPSession(unittest.TestCase):
with requests.Session() as session: with requests.Session() as session:
session.verify = False session.verify = False
session.auth = (AUTH.username, AUTH.password) session.auth = (AUTH.username, AUTH.password)
r = session.get(BASE_URL + 'task_draft/?format=api') r = session.get(BASE_URL + '/task_draft/?format=api')
self.assertEqual(r.status_code, 200) self.assertEqual(r.status_code, 200)
self.assertTrue("Task Draft List" in r.content.decode('utf8')) self.assertTrue("Task Draft List" in r.content.decode('utf8'))
...@@ -83,7 +83,7 @@ class OIDCSession(unittest.TestCase): ...@@ -83,7 +83,7 @@ class OIDCSession(unittest.TestCase):
def test_failure_without_authentication(self): def test_failure_without_authentication(self):
with requests.Session() as session: with requests.Session() as session:
session.verify = False session.verify = False
r = session.get(BASE_URL + 'task_draft/?format=api') r = session.get(BASE_URL + '/task_draft/?format=api')
self.assertEqual(r.status_code, 401) self.assertEqual(r.status_code, 401)
self.assertTrue("Authentication credentials were not provided" in r.content.decode('utf8')) self.assertTrue("Authentication credentials were not provided" in r.content.decode('utf8'))
...@@ -98,7 +98,7 @@ class OIDCSession(unittest.TestCase): ...@@ -98,7 +98,7 @@ class OIDCSession(unittest.TestCase):
@integration_test @integration_test
def test_success_using_correct_credentials(self): def test_success_using_correct_credentials(self):
with TMSSsession(AUTH.username, AUTH.password, BASE_URL.replace('/api', '')).session as session: with TMSSsession(AUTH.username, AUTH.password, BASE_URL.replace('/api', '')).session as session:
r = session.get(BASE_URL + 'task_draft/?format=api') r = session.get(BASE_URL + '/task_draft/?format=api')
self.assertEqual(r.status_code, 200) self.assertEqual(r.status_code, 200)
self.assertTrue("Task Draft List" in r.content.decode('utf8')) self.assertTrue("Task Draft List" in r.content.decode('utf8'))
......
...@@ -448,7 +448,7 @@ class TMSSRESTTestDataCreator(): ...@@ -448,7 +448,7 @@ class TMSSRESTTestDataCreator():
return {"filename": filename, return {"filename": filename,
"directory": directory, "directory": directory,
"dataformat": "%sdataformat/%s/" % (self.django_api_url, dataformat), "dataformat": "%s/dataformat/%s/" % (self.django_api_url, dataformat),
"deleted_since": None, "deleted_since": None,
"pinned_since": None, "pinned_since": None,
"specifications_doc": "{}", "specifications_doc": "{}",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment