mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-24 02:05:48 -06:00
Tweak: improve tag parent validation error handling (#11096)
This commit is contained in:
@@ -171,7 +171,7 @@ class TestTagHierarchy(APITestCase):
|
||||
)
|
||||
assert resp_fail.status_code == 400
|
||||
assert "parent" in resp_fail.data
|
||||
assert "Invalid" in str(resp_fail.data["parent"])
|
||||
assert "Maximum nesting depth exceeded" in str(resp_fail.data["parent"])
|
||||
|
||||
def test_max_depth_on_move_subtree(self):
|
||||
a = Tag.objects.create(name="A2")
|
||||
@@ -191,7 +191,7 @@ class TestTagHierarchy(APITestCase):
|
||||
)
|
||||
assert resp_fail.status_code == 400
|
||||
assert "Maximum nesting depth exceeded" in str(
|
||||
resp_fail.data["non_field_errors"],
|
||||
resp_fail.data["parent"],
|
||||
)
|
||||
|
||||
# Moving X under C (depth 3) should be allowed (deepest becomes 5)
|
||||
|
||||
Reference in New Issue
Block a user