|
|
@@ -97,13 +97,18 @@ class TestCustomizeForm(unittest.TestCase): |
|
|
|
|
|
|
|
custom_field = d.get("fields", {"fieldname": "test_custom_field"})[0] |
|
|
|
custom_field.reqd = 1 |
|
|
|
custom_field.no_copy = 1 |
|
|
|
d.run_method("save_customization") |
|
|
|
self.assertEqual(frappe.db.get_value("Custom Field", "Event-test_custom_field", "reqd"), 1) |
|
|
|
self.assertEqual(frappe.db.get_value("Custom Field", "Event-test_custom_field", "no_copy"), 1) |
|
|
|
|
|
|
|
custom_field = d.get("fields", {"is_custom_field": True})[0] |
|
|
|
custom_field.reqd = 0 |
|
|
|
custom_field.no_copy = 0 |
|
|
|
d.run_method("save_customization") |
|
|
|
self.assertEqual(frappe.db.get_value("Custom Field", "Event-test_custom_field", "reqd"), 0) |
|
|
|
self.assertEqual(frappe.db.get_value("Custom Field", "Event-test_custom_field", "no_copy"), 0) |
|
|
|
|
|
|
|
|
|
|
|
def test_save_customization_new_field(self): |
|
|
|
d = self.get_customize_form("Event") |
|
|
|