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:
@@ -14,8 +14,6 @@ import responses
|
||||
import svn.common
|
||||
|
||||
import pillarsdk
|
||||
import pillar
|
||||
import pillar.tests.common_test_data as ctd
|
||||
|
||||
import logging_config
|
||||
from abstract_attract_test import AbstractAttractTest
|
||||
@@ -246,14 +244,18 @@ class SvnTaskLoggedTest(AbstractAttractTest):
|
||||
def setUp(self, **kwargs):
|
||||
AbstractAttractTest.setUp(self, **kwargs)
|
||||
|
||||
import pillar.tests
|
||||
|
||||
self.mngr = self.attract.task_manager
|
||||
self.proj_id, self.project = self.ensure_project_exists()
|
||||
self.sdk_project = pillarsdk.Project(pillar.tests.mongo_to_sdk(self.project))
|
||||
|
||||
def create_task(self, task_type=None):
|
||||
import pillar.tests.common_test_data as ctd
|
||||
|
||||
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()
|
||||
sdk_task = self.mngr.create_task(self.sdk_project, task_type=task_type)
|
||||
|
Reference in New Issue
Block a user