Skip to content

Commit

Permalink
Merge pull request #85 from 8848digital/issue-1280
Browse files Browse the repository at this point in the history
fix: resolved frappe.exceptions.DoesNotExistError: DocType Payment Gateway not found issue
  • Loading branch information
Satya8848 authored Feb 24, 2025
2 parents 5701631 + 9ff5f75 commit b24113a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 3 additions & 1 deletion frappe/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from frappe.model.naming import revert_series_if_last
from frappe.modules import get_module_name, load_doctype_module
from frappe.utils import cint
from frappe.tests.utils import check_doctype_and_module

unittest_runner = unittest.TextTestRunner
SLOW_TEST_THRESHOLD = 2
Expand Down Expand Up @@ -331,7 +332,7 @@ def _add_test(app, path, filename, verbose, test_suite=None):


def make_test_records(doctype, verbose=0, force=False, commit=False):
if frappe.flags.skip_test_records:
if frappe.flags.skip_test_records or not check_doctype_and_module(doctype):
return

for options in get_dependencies(doctype):
Expand All @@ -358,6 +359,7 @@ def get_modules(doctype):

def get_dependencies(doctype):
module, test_module = get_modules(doctype)

meta = frappe.get_meta(doctype)
link_fields = meta.get_link_fields()

Expand Down
13 changes: 12 additions & 1 deletion frappe/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,4 +398,15 @@ def wrapper(function):
if app not in frappe.get_installed_apps():
return function
return
return wrapper
return wrapper


def check_doctype_and_module(doctype):
if not frappe.db.exists("DocType", doctype):
return False

module = frappe.db.get_value("DocType", doctype, "module")
if not module:
return False

return True

0 comments on commit b24113a

Please sign in to comment.