Fixed authentication issues in unit tests

The tests were logging in incorrectly, which came to light due to Pillar
commit 4b5a961e1422d8e976b2bf8bb9a4f91addf9bbec.
This commit is contained in:
2018-02-01 11:43:14 +01:00
parent 39a23a80c9
commit cf41599e20
4 changed files with 24 additions and 15 deletions

View File

@@ -6,7 +6,6 @@ import responses
from bson import ObjectId
import pillarsdk
import pillarsdk.exceptions as sdk_exceptions
import pillar.tests
import pillar.auth
import pillar.tests.common_test_data as ctd
@@ -28,7 +27,7 @@ class AbstractShotTest(AbstractAttractTest):
def create_task(self, shot_id, task_type):
with self.app.test_request_context():
# Log in as project admin user
pillar.auth.login_user(ctd.EXAMPLE_PROJECT_OWNER_ID)
self.login_api_as(ctd.EXAMPLE_PROJECT_OWNER_ID)
self.mock_blenderid_validate_happy()
task = self.tmngr.create_task(self.sdk_project, parent=shot_id, task_type=task_type)
@@ -39,7 +38,7 @@ class AbstractShotTest(AbstractAttractTest):
def create_shot(self):
with self.app.test_request_context():
# Log in as project admin user
pillar.auth.login_user(ctd.EXAMPLE_PROJECT_OWNER_ID)
self.login_api_as(ctd.EXAMPLE_PROJECT_OWNER_ID)
self.mock_blenderid_validate_happy()
shot = self.smngr.create_shot(self.sdk_project)
@@ -67,7 +66,7 @@ class ShotManagerTest(AbstractShotTest):
with self.app.test_request_context():
# Log in as project admin user
pillar.auth.login_user(ctd.EXAMPLE_PROJECT_OWNER_ID)
self.login_api_as(ctd.EXAMPLE_PROJECT_OWNER_ID)
self.mock_blenderid_validate_happy()
shot_id_to_task = self.smngr.tasks_for_nodes([shot1, shot2],
@@ -96,7 +95,7 @@ class ShotManagerTest(AbstractShotTest):
with self.app.test_request_context():
# Log in as project admin user
pillar.auth.login_user(ctd.EXAMPLE_PROJECT_OWNER_ID)
self.login_api_as(ctd.EXAMPLE_PROJECT_OWNER_ID)
self.mock_blenderid_validate_happy()
@@ -134,7 +133,7 @@ class ShotManagerTest(AbstractShotTest):
with self.app.test_request_context():
# Log in as project admin user
pillar.auth.login_user(ctd.EXAMPLE_PROJECT_OWNER_ID)
self.login_api_as(ctd.EXAMPLE_PROJECT_OWNER_ID)
self.mock_blenderid_validate_happy()
for shot, status in zip([shot1, shot2, shot3, shot4],