seitime-frappe/frappe/tests/test_patches.py
Aditya Hase 837bfc0995 fix(unicode): Import unicode_literals in every file (#6805)
* fix(unicode): Import unicode_literals in every file

* fix(unicode): Test if safe_json_loads return unicode instead of bytes
2019-01-25 11:56:27 +05:30

17 lines
566 B
Python

from __future__ import unicode_literals
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