seitime-frappe/frappe/tests/test_patches.py
2017-04-13 13:36:33 +05:30

16 lines
526 B
Python

import unittest, frappe
from frappe.modules import patch_handler
class TestPatches(unittest.TestCase):
def test_patch_module_names(self):
frappe.flags.final_patches = []
frappe.flags.in_install = True
for patchmodule in patch_handler.get_all_patches():
if patchmodule.startswith("execute:"):
pass
else:
if patchmodule.startswith("finally:"):
patchmodule = patchmodule.split('finally:')[-1]
self.assertTrue(frappe.get_attr(patchmodule.split()[0] + ".execute"))
frappe.flags.in_install = False