Add pagination to AuditLog.get_all_events

This commit is contained in:
richard-dds
2018-11-12 15:33:14 -05:00
parent a30cf31553
commit c3e395753c
3 changed files with 49 additions and 4 deletions

View File

@@ -22,3 +22,12 @@ def test_non_admin_cannot_view_audit_log(developer):
def test_ccpo_can_iview_audit_log(ccpo):
AuditLog.get_all_events(ccpo)
def test_paginate_audit_log(ccpo):
user = UserFactory.create()
for _ in range(100):
AuditLog.log_system_event(user, action="create")
events = AuditLog.get_all_events(ccpo, pagination={"per_page": 25, "page": 2})
assert len(events) == 25