Update tests to use uuid in session
This commit is contained in:
parent
9d677b8eb3
commit
faeb3b9a10
1 changed files with 5 additions and 5 deletions
|
@ -79,7 +79,7 @@ class ApiTestCase(unittest.TestCase):
|
||||||
with client.session_transaction() as sess:
|
with client.session_transaction() as sess:
|
||||||
if auth_username:
|
if auth_username:
|
||||||
loaded = model.get_user(auth_username)
|
loaded = model.get_user(auth_username)
|
||||||
sess['user_id'] = loaded.id
|
sess['user_id'] = loaded.uuid
|
||||||
sess['login_time'] = datetime.datetime.now()
|
sess['login_time'] = datetime.datetime.now()
|
||||||
sess[CSRF_TOKEN_KEY] = CSRF_TOKEN
|
sess[CSRF_TOKEN_KEY] = CSRF_TOKEN
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ class ApiTestCase(unittest.TestCase):
|
||||||
final_url = self.url
|
final_url = self.url
|
||||||
if method != 'GET' and method != 'HEAD':
|
if method != 'GET' and method != 'HEAD':
|
||||||
final_url = self._add_csrf(self.url)
|
final_url = self._add_csrf(self.url)
|
||||||
|
|
||||||
open_kwargs.update({
|
open_kwargs.update({
|
||||||
'data': json.dumps(request_body),
|
'data': json.dumps(request_body),
|
||||||
'content_type': 'application/json',
|
'content_type': 'application/json',
|
||||||
|
@ -1069,7 +1069,7 @@ class TestBuildTriggerActivateSwo1BuynlargeOrgrepo(ApiTestCase):
|
||||||
class TestBuildTriggerFieldValuesSwo1PublicPublicrepo(ApiTestCase):
|
class TestBuildTriggerFieldValuesSwo1PublicPublicrepo(ApiTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
ApiTestCase.setUp(self)
|
ApiTestCase.setUp(self)
|
||||||
self._set_url(BuildTriggerFieldValues, trigger_uuid="SWO1", repository="public/publicrepo",
|
self._set_url(BuildTriggerFieldValues, trigger_uuid="SWO1", repository="public/publicrepo",
|
||||||
field_name="test_field")
|
field_name="test_field")
|
||||||
|
|
||||||
def test_post_anonymous(self):
|
def test_post_anonymous(self):
|
||||||
|
@ -1088,7 +1088,7 @@ class TestBuildTriggerFieldValuesSwo1PublicPublicrepo(ApiTestCase):
|
||||||
class TestBuildTriggerFieldValuesSwo1DevtableShared(ApiTestCase):
|
class TestBuildTriggerFieldValuesSwo1DevtableShared(ApiTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
ApiTestCase.setUp(self)
|
ApiTestCase.setUp(self)
|
||||||
self._set_url(BuildTriggerFieldValues, trigger_uuid="SWO1", repository="devtable/shared",
|
self._set_url(BuildTriggerFieldValues, trigger_uuid="SWO1", repository="devtable/shared",
|
||||||
field_name="test_field")
|
field_name="test_field")
|
||||||
|
|
||||||
def test_post_anonymous(self):
|
def test_post_anonymous(self):
|
||||||
|
@ -1107,7 +1107,7 @@ class TestBuildTriggerFieldValuesSwo1DevtableShared(ApiTestCase):
|
||||||
class TestBuildTriggerFieldValuesSwo1BuynlargeOrgrepo(ApiTestCase):
|
class TestBuildTriggerFieldValuesSwo1BuynlargeOrgrepo(ApiTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
ApiTestCase.setUp(self)
|
ApiTestCase.setUp(self)
|
||||||
self._set_url(BuildTriggerFieldValues, trigger_uuid="SWO1", repository="buynlarge/orgrepo",
|
self._set_url(BuildTriggerFieldValues, trigger_uuid="SWO1", repository="buynlarge/orgrepo",
|
||||||
field_name="test_field")
|
field_name="test_field")
|
||||||
|
|
||||||
def test_post_anonymous(self):
|
def test_post_anonymous(self):
|
||||||
|
|
Reference in a new issue