From 918dbdc4cbc9d7d1612ebf494312f91ad4112ca5 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 12 Sep 2025 08:16:42 -0700 Subject: [PATCH] Add another explicit api test to illustrate --- src/documents/tests/test_tag_hierarchy.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/documents/tests/test_tag_hierarchy.py b/src/documents/tests/test_tag_hierarchy.py index a1dc3776d..8a4f703ab 100644 --- a/src/documents/tests/test_tag_hierarchy.py +++ b/src/documents/tests/test_tag_hierarchy.py @@ -42,7 +42,17 @@ class TestTagHierarchy(APITestCase): tags = set(self.document.tags.values_list("pk", flat=True)) assert tags == {self.parent.pk, self.child.pk} - def test_api_remove_parent_removes_child(self): + def test_document_api_add_child_adds_parent(self): + self.client.patch( + f"/api/documents/{self.document.pk}/", + {"tags": [self.child.pk]}, + format="json", + ) + self.document.refresh_from_db() + tags = set(self.document.tags.values_list("pk", flat=True)) + assert tags == {self.parent.pk, self.child.pk} + + def test_document_api_remove_parent_removes_child(self): self.document.add_nested_tags([self.child]) self.client.patch( f"/api/documents/{self.document.pk}/",