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

@@ -28,6 +28,7 @@ class AbstractAttractTest(AbstractPillarTest):
def ensure_project_exists(self, project_overrides=None):
from attract.setup import setup_for_attract
import pillar.tests.common_test_data as ctd
project_overrides = dict(
picture_header=None,
@@ -35,6 +36,7 @@ class AbstractAttractTest(AbstractPillarTest):
**(project_overrides or {})
)
proj_id, project = AbstractPillarTest.ensure_project_exists(self, project_overrides)
ctd.EXAMPLE_USER['groups'].append(ctd.EXAMPLE_ADMIN_GROUP_ID)
with self.app.test_request_context():
attract_project = setup_for_attract(project['url'],