Automatic audit logging using SQLA events
This commit is contained in:
20
tests/domain/test_audit_log.py
Normal file
20
tests/domain/test_audit_log.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import pytest
|
||||
|
||||
from atst.domain.audit_log import AuditLog
|
||||
from atst.domain.exceptions import UnauthorizedError
|
||||
from tests.factories import UserFactory
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def ccpo():
|
||||
return UserFactory.from_atat_role("ccpo")
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def developer():
|
||||
return UserFactory.from_atat_role("default")
|
||||
|
||||
|
||||
def test_non_admin_cannot_view_audit_log(developer):
|
||||
with pytest.raises(UnauthorizedError):
|
||||
AuditLog.get_all_events(developer)
|
@@ -1,10 +1,11 @@
|
||||
from atst.domain.projects import Projects
|
||||
from atst.domain.workspaces import Workspaces
|
||||
from tests.factories import RequestFactory
|
||||
from atst.domain.workspaces import Workspaces
|
||||
|
||||
|
||||
def test_create_project_with_multiple_environments():
|
||||
workspace = Workspaces.create(RequestFactory.create())
|
||||
request = RequestFactory.create()
|
||||
workspace = Workspaces.create(request)
|
||||
project = Projects.create(
|
||||
workspace.owner, workspace, "My Test Project", "Test", ["dev", "prod"]
|
||||
)
|
||||
|
Reference in New Issue
Block a user