fixes
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
d6dbfd5d3f
commit
562c6aca96
|
@ -1,10 +1,9 @@
|
||||||
from flask import Blueprint, request
|
from flask import Blueprint
|
||||||
from zope import component
|
from zope import component
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
|
||||||
from ceod.api.utils import authz_restrict_to_staff, authz_restrict_to_syscom, \
|
from ceod.api.utils import authz_restrict_to_syscom, user_is_in_group, requires_authentication_no_realm, \
|
||||||
user_is_in_group, requires_authentication_no_realm, \
|
development_only
|
||||||
create_streaming_response, development_only
|
|
||||||
from ceo_common.errors import UserNotFoundError, DatabaseConnectionError, DatabasePermissionError, \
|
from ceo_common.errors import UserNotFoundError, DatabaseConnectionError, DatabasePermissionError, \
|
||||||
InvalidUsernameError, UserAlreadyExistsError
|
InvalidUsernameError, UserAlreadyExistsError
|
||||||
from ceo_common.interfaces import ILDAPService, IDatabaseService
|
from ceo_common.interfaces import ILDAPService, IDatabaseService
|
||||||
|
|
|
@ -22,7 +22,7 @@ def test_api_create_mysql_db(cfg, client, g_admin_ctx, create_user_result):
|
||||||
assert status == 409
|
assert status == 409
|
||||||
|
|
||||||
# normal user cannot create db for others
|
# normal user cannot create db for others
|
||||||
status, data = client.post(f"/api/mysql/someone_else", json={}, principal=uid)
|
status, data = client.post("/api/mysql/someone_else", json={}, principal=uid)
|
||||||
assert status == 403
|
assert status == 403
|
||||||
|
|
||||||
# cannot create db for user not in ldap
|
# cannot create db for user not in ldap
|
||||||
|
@ -85,9 +85,9 @@ def test_api_passwd_reset_mysql(cfg, client, g_admin_ctx, create_user_result):
|
||||||
old_passwd = data['password']
|
old_passwd = data['password']
|
||||||
|
|
||||||
con = connect(
|
con = connect(
|
||||||
host=cfg.get('ceod_database_host'),
|
host=cfg.get('ceod_database_host'),
|
||||||
user=uid,
|
user=uid,
|
||||||
password=old_passwd,
|
password=old_passwd,
|
||||||
)
|
)
|
||||||
con.close()
|
con.close()
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ def test_api_passwd_reset_mysql(cfg, client, g_admin_ctx, create_user_result):
|
||||||
assert status == 403
|
assert status == 403
|
||||||
|
|
||||||
# cannot password reset a user that does not have a database
|
# cannot password reset a user that does not have a database
|
||||||
status, data = client.post(f"/api/mysql/someone_else/pwreset", json={})
|
status, data = client.post("/api/mysql/someone_else/pwreset", json={})
|
||||||
assert status == 404
|
assert status == 404
|
||||||
|
|
||||||
con = connect(
|
con = connect(
|
||||||
|
|
|
@ -21,7 +21,7 @@ def test_api_create_psql_db(cfg, client, g_admin_ctx, create_user_result):
|
||||||
assert status == 409
|
assert status == 409
|
||||||
|
|
||||||
# normal user cannot create db for others
|
# normal user cannot create db for others
|
||||||
status, data = client.post(f"/api/postgresql/someone_else", json={}, principal=uid)
|
status, data = client.post("/api/postgresql/someone_else", json={}, principal=uid)
|
||||||
assert status == 403
|
assert status == 403
|
||||||
|
|
||||||
# cannot create db for user not in ldap
|
# cannot create db for user not in ldap
|
||||||
|
@ -84,9 +84,9 @@ def test_api_passwd_reset_psql(cfg, client, g_admin_ctx, create_user_result):
|
||||||
old_passwd = data['password']
|
old_passwd = data['password']
|
||||||
|
|
||||||
con = connect(
|
con = connect(
|
||||||
host=cfg.get('ceod_database_host'),
|
host=cfg.get('ceod_database_host'),
|
||||||
user=uid,
|
user=uid,
|
||||||
password=old_passwd,
|
password=old_passwd,
|
||||||
)
|
)
|
||||||
con.close()
|
con.close()
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ def test_api_passwd_reset_psql(cfg, client, g_admin_ctx, create_user_result):
|
||||||
assert status == 403
|
assert status == 403
|
||||||
|
|
||||||
# cannot password reset a user that does not have a database
|
# cannot password reset a user that does not have a database
|
||||||
status, data = client.post(f"/api/postgresql/someone_else/pwreset", json={})
|
status, data = client.post("/api/postgresql/someone_else/pwreset", json={})
|
||||||
assert status == 404
|
assert status == 404
|
||||||
|
|
||||||
con = connect(
|
con = connect(
|
||||||
|
|
Loading…
Reference in New Issue