From de65699d49959aaaea8aec45d06f1e3963fa2044 Mon Sep 17 00:00:00 2001 From: Ninad Parikh <109862100+Ninad1306@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:34:17 +0530 Subject: [PATCH] test: test for property setter old doc check (#1786) * test: test case to validate customize form * test: test case to validate customize form * test: test case to validate old_doc is protected or not --------- Co-authored-by: Ninad Parikh --- .../audit_trail/overrides/test_property_setter.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/india_compliance/audit_trail/overrides/test_property_setter.py b/india_compliance/audit_trail/overrides/test_property_setter.py index ec5f24a75..f7680bb1a 100644 --- a/india_compliance/audit_trail/overrides/test_property_setter.py +++ b/india_compliance/audit_trail/overrides/test_property_setter.py @@ -32,5 +32,12 @@ def test_validate_property_setter_where_audit_trail_enabled_and_doc_is_protected re.compile(r"^(Cannot change the Track Changes property for*)"), doc.delete, ) + doc.reload() + doc.doc_type = "Address" + self.assertRaisesRegex( + frappe.ValidationError, + re.compile(r"^(Cannot change the Track Changes property for*)"), + doc.save, + ) frappe.db.set_single_value("Accounts Settings", "enable_audit_trail", 0) doc.delete()