about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi <fredmanglis@gmail.com>2026-10-05 10:11:45 -0500
committerFrederick Muriuki Muriithi <fredmanglis@gmail.com>2026-10-05 11:36:26 -0500
commit2ebc99cf340547a7276209cf39a54caad62a1bb6 (patch)
tree9b0ad5b9f230eb7f7037bbdc65dbafd61162741c /tests
parentf5af9014450136fbc154a5d1ffe4311e1338367b (diff)
downloadgn-auth-2ebc99cf340547a7276209cf39a54caad62a1bb6.tar.gz
fix (resources/base): Make `created_by` mandatory.
The `created_by` field is mandatory, and every resource should have a
creator, including the system itself. Any chicken/egg situation that
arises from this situation should be resolved by manually editing the
data or building code to initialise the application at startup, not by
ignoring this invariant.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/auth/test_resources.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/unit/auth/test_resources.py b/tests/unit/auth/test_resources.py
index 81f967e..31dc1c7 100644
--- a/tests/unit/auth/test_resources.py
+++ b/tests/unit/auth/test_resources.py
@@ -1,5 +1,6 @@
 """Test resource-management functions"""
 import uuid
+from datetime import datetime
 
 import pytest
 
@@ -29,7 +30,8 @@ create_resource_failure = {
         conftest.TEST_USERS[0:1],
         (Resource(
             uuid.UUID("d32611e3-07fc-4564-b56c-786c6db6de2b"),
-            "test_resource", resource_category, False),))))
+            "test_resource", resource_category, False,
+            conftest.TEST_USERS[0]),))))
 def test_create_resource(# pylint: disable=[too-many-arguments, too-many-positional-arguments, unused-argument]
         mocker,
         fxtr_users_in_group,
@@ -50,7 +52,8 @@ def test_create_resource(# pylint: disable=[too-many-arguments, too-many-positio
 
     with db.cursor(conn) as cursor:
         resource = create_resource(
-            conn, "test_resource", resource_category, user, _group, False)
+            conn, "test_resource", resource_category, user, _group, False,
+            datetime(1970, 1, 1, 0, 0, 0))
         assert resource == expected
         # Cleanup
         cursor.execute(