浏览代码

[test] check patch names

version-14
Rushabh Mehta 8 年前
committed by Nabin Hait
父节点
当前提交
510f2e51ac
共有 2 个文件被更改,包括 17 次插入1 次删除
  1. +1
    -1
      frappe/patches/v4_0/create_custom_field_for_owner_match.py
  2. +16
    -0
      frappe/tests/test_patches.py

+ 1
- 1
frappe/patches/v4_0/create_custom_field_for_owner_match.py 查看文件

@@ -3,7 +3,7 @@

from __future__ import unicode_literals
import frappe
from frappe.core.doctype.custom_field.custom_field import create_custom_field
from frappe.custom.doctype.custom_field.custom_field import create_custom_field

def execute():
if "match" in frappe.db.get_table_columns("DocPerm"):


+ 16
- 0
frappe/tests/test_patches.py 查看文件

@@ -0,0 +1,16 @@
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

正在加载...
取消
保存