Skip to content

Commit a63ee07

Browse files
committed
Fix tests
1 parent be29b2d commit a63ee07

4 files changed

Lines changed: 21 additions & 2 deletions

File tree

web/tests/functional/authentication/test_authentication.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ def test_announcement_showing_in_cli(self):
738738
session_token='_PROHIBIT')
739739
session_token = auth_client.performLogin(
740740
"Username:Password", "root:root")
741+
auth_client = env.setup_auth_client(self._test_workspace,
742+
session_token=session_token)
741743

742744
auth_client.addPermission(Permission.SUPERUSER, "root", False, "")
743745

web/tests/functional/component/test_component.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,10 @@ def setup_method(self, _):
136136
session_token='_PROHIBIT')
137137

138138
# Create a PRODUCT_ADMIN login.
139-
admin_token = self._auth_client.performLogin("Username:Password",
140-
"admin:admin123")
139+
root_token = self._auth_client.performLogin("Username:Password",
140+
"root:root")
141+
self._auth_client = env.setup_auth_client(self._test_workspace,
142+
session_token=root_token)
141143

142144
extra_params = '{"productID":' + str(product_id) + '}'
143145
ret = self._auth_client.addPermission(Permission.PRODUCT_ADMIN,
@@ -146,6 +148,9 @@ def setup_method(self, _):
146148
extra_params)
147149
self.assertTrue(ret)
148150

151+
admin_token = self._auth_client.performLogin("Username:Password",
152+
"admin:admin123")
153+
149154
self._cc_client = env.setup_viewer_client(self._test_workspace,
150155
session_token=admin_token)
151156
self.assertIsNotNone(self._cc_client)

web/tests/functional/products/test_config_db_share.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,14 @@ def setup_method(self, _):
7575
# Create a SUPERUSER login.
7676
root_token = self._auth_client.performLogin("Username:Password",
7777
"root:root")
78+
self._auth_client = env.setup_auth_client(self.test_workspace_main,
79+
session_token=root_token)
7880

7981
# Add SUPERUSER permission to the root user and test that the white
8082
# spaces are being removed from the user name.
83+
# TODO: I'm not sure if this test makes sense, because "root" user has
84+
# SUPERUSER permission already. "root" is set as "super_user" in
85+
# server_config.json.
8186
ret = self._auth_client.addPermission(Permission.SUPERUSER,
8287
" root ",
8388
False,

web/tests/functional/server_configuration/test_server_configuration.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ def get_su_config_client(self):
122122
self.session_token = self.auth_client.performLogin(
123123
"Username:Password", "root:root")
124124

125+
self.auth_client = env.setup_auth_client(
126+
self._test_workspace,
127+
session_token=self.session_token)
128+
129+
# TODO: I'm not sure if this test makes sense, because "root" user has
130+
# SUPERUSER permission already. "root" is set as "super_user" in
131+
# server_config.json.
125132
ret = self.auth_client.addPermission(Permission.SUPERUSER,
126133
"root",
127134
False,

0 commit comments

Comments
 (0)