-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2587 from resilient-tech/version-14-hotfix
chore: release v14
- Loading branch information
Showing
7 changed files
with
37 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import frappe | ||
from frappe.modules.patch_handler import get_patches_from_app | ||
from frappe.tests.utils import FrappeTestCase | ||
|
||
from india_compliance.install import POST_INSTALL_PATCHES | ||
|
||
|
||
class TestPatches(FrappeTestCase): | ||
def test_post_install_patch_exists(self): | ||
for patch in POST_INSTALL_PATCHES: | ||
self.assertTrue( | ||
frappe.get_attr( | ||
f"india_compliance.patches.post_install.{patch}.execute" | ||
) | ||
) | ||
|
||
def test_patches_exists(self): | ||
patches = get_patches_from_app("india_compliance") | ||
|
||
for patch in patches: | ||
if patch.startswith("execute:"): | ||
import_path = patch.split("execute:")[1] | ||
|
||
if not import_path.startswith("from"): | ||
continue | ||
|
||
components = import_path.split("from")[1].split() | ||
module = components[0] | ||
function_name = components[2].replace(";", "").replace(",", "") | ||
patch_path = module + "." + function_name | ||
else: | ||
patch_path = f"{patch.split(maxsplit=1)[0]}.execute" | ||
|
||
frappe.get_attr(patch_path) |