fix(oa): coerce dept max prop when validating form_data

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-07-27 18:26:57 +08:00
1 parent 260a461d05
commit babe26a23d
2 files changed
+45 -9

No files matched your search

+19
View File
@@ -70,6 +70,25 @@ class TestValidateDeptFormValues(unittest.TestCase):
errs = validate_dept_form_values(schema, data)
self.assertTrue(any("最大" in e or "上限" in e for e in errs))
def test_max_exceeded_string_max(self):
schema = {
"rule": [
{
"type": "dept",
"field": "depts",
"props": {"multiple": True, "max": "1"},
}
]
}
data = {
"depts": [
{"id": "d1", "name": "A"},
{"id": "d2", "name": "B"},
]
}
errs = validate_dept_form_values(schema, data)
self.assertTrue(any("最大" in e or "上限" in e for e in errs))
def test_nested_fc_row(self):
schema = {
"rule": [