From 565b8de787ad7c87a574f8850f12735bb86ae175 Mon Sep 17 00:00:00 2001 From: rbi-aap Date: Mon, 2 Sep 2024 15:09:52 +1000 Subject: [PATCH] update --- tests/fixtures.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tests/fixtures.py b/tests/fixtures.py index 5a26926a..8186a776 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -4,7 +4,6 @@ from datetime import datetime, timedelta from superdesk.utc import utcnow from flask import url_for -# from tests.test_users import test_login_succeeds_for_admin, init as users_init PUBLIC_USER_ID = ObjectId('59b4c5c61d41c8d736852fbf') TEST_USER_ID = ObjectId('5cc94454bc43165c045ffec9') @@ -218,6 +217,8 @@ def setup_user_company(app): @fixture(autouse=True) def init_company(app): setup_user_company(app) + + def test_login_succeeds_for_admin(client): response = client.post( url_for('auth.login'), @@ -226,17 +227,18 @@ def test_login_succeeds_for_admin(client): ) assert response.status_code == 200 + def users_init(app): - app.data.insert('users', [{ - '_id': ObjectId(ADMIN_USER_ID), - 'first_name': 'admin', - 'last_name': 'admin', - 'email': 'admin@sourcefabric.org', - 'password': '$2b$12$HGyWCf9VNfnVAwc2wQxQW.Op3Ejk7KIGE6urUXugpI0KQuuK6RWIG', - 'user_type': 'administrator', - 'is_validated': True, - 'is_enabled': True, - 'is_approved': True, - 'receive_email': True, - }]) + app.data.insert('users', [{ + '_id': ObjectId(ADMIN_USER_ID), + 'first_name': 'admin', + 'last_name': 'admin', + 'email': 'admin@sourcefabric.org', + 'password': '$2b$12$HGyWCf9VNfnVAwc2wQxQW.Op3Ejk7KIGE6urUXugpI0KQuuK6RWIG', + 'user_type': 'administrator', + 'is_validated': True, + 'is_enabled': True, + 'is_approved': True, + 'receive_email': True, + }])