Skip to content

Commit dff1872

Browse files
Paul Hewletteccles
authored andcommitted
Filter subjects on display name
Problem: Common practice is to be able to get subjects by display name as well as identity. Solution: Archivist allows filtering on display name and this has been enabled here (whereas before it was commented out) Signed-off-by: Paul Hewlett <phewlett76@gmail.com>
1 parent 95cf481 commit dff1872

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

archivist/subjects.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ def list(
217217
"""List subjects.
218218
219219
List subjects that match criteria.
220-
TODO: filtering on display_name does not currently work
221220
222221
Args:
223222
display_name (str): display name (optional)

functests/execsubjects.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Test subjects
33
"""
44

5+
from json import dumps as json_dumps
56
from os import environ
67
from unittest import TestCase
78
from uuid import uuid4
@@ -93,14 +94,16 @@ def test_subjects_list(self):
9394
"""
9495
Test subject list
9596
"""
96-
# TODO: filtering on display_name does not currently work...
9797
subjects = self.arch.subjects.list(display_name=self.display_name)
98+
for i, subject in enumerate(subjects):
99+
print(i, ":", json_dumps(subject, indent=4))
100+
98101
for subject in subjects:
99-
# self.assertEqual(
100-
# subject["display_name"],
101-
# self.display_name,
102-
# msg="Incorrect display name",
103-
# )
102+
self.assertEqual(
103+
subject["display_name"],
104+
self.display_name,
105+
msg="Incorrect display name",
106+
)
104107
self.assertGreater(
105108
len(subject["display_name"]),
106109
0,

0 commit comments

Comments
 (0)