|
|
|
@ -4,8 +4,9 @@ from ceod.model import User |
|
|
|
|
from psycopg2 import connect, OperationalError, ProgrammingError |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_api_create_psql_db(cfg, client, g_admin_ctx, create_user_result): |
|
|
|
|
uid = create_user_result['uid'] |
|
|
|
|
def test_api_create_psql_db(cfg, client, g_admin_ctx, ldap_user): |
|
|
|
|
uid = ldap_user.uid |
|
|
|
|
|
|
|
|
|
with g_admin_ctx(): |
|
|
|
|
user = User(uid='someone_else', cn='Some Name', terms=['s2021']) |
|
|
|
|
user.add_to_ldap() |
|
|
|
@ -71,13 +72,13 @@ def test_api_create_psql_db(cfg, client, g_admin_ctx, create_user_result): |
|
|
|
|
user.remove_from_ldap() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_api_passwd_reset_psql(cfg, client, g_admin_ctx, create_user_result): |
|
|
|
|
def test_api_passwd_reset_psql(cfg, client, g_admin_ctx, ldap_user): |
|
|
|
|
uid = ldap_user.uid |
|
|
|
|
|
|
|
|
|
with g_admin_ctx(): |
|
|
|
|
user = User(uid='someone_else', cn='Some Name', terms=['s2021']) |
|
|
|
|
user.add_to_ldap() |
|
|
|
|
|
|
|
|
|
uid = create_user_result['uid'] |
|
|
|
|
|
|
|
|
|
status, data = client.post(f"/api/postgresql/{uid}", json={}) |
|
|
|
|
assert status == 200 |
|
|
|
|
assert 'password' in data |
|
|
|
|