Selaa lähdekoodia

[test] check patch names

version-14
Rushabh Mehta 8 vuotta sitten
committed by Nabin Hait
vanhempi
commit
510f2e51ac
2 muutettua tiedostoa jossa 17 lisäystä ja 1 poistoa
  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 Näytä tiedosto

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


from __future__ import unicode_literals from __future__ import unicode_literals
import frappe 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(): def execute():
if "match" in frappe.db.get_table_columns("DocPerm"): if "match" in frappe.db.get_table_columns("DocPerm"):


+ 16
- 0
frappe/tests/test_patches.py Näytä tiedosto

@@ -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

Ladataan…
Peruuta
Tallenna