seitime-frappe/frappe/tests/test_config.py
David 091df9fe2b
refactor!: make room in the frappe.config namespace
BRAKING: fappe.config namespace moved to
frappe.utils.modules namespace
2024-09-12 12:18:58 +02:00

14 lines
623 B
Python

# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.utils.modules import get_modules_from_all_apps_for_user
class TestConfig(FrappeTestCase):
def test_get_modules(self):
frappe_modules = frappe.get_all("Module Def", filters={"app_name": "frappe"}, pluck="name")
all_modules_data = get_modules_from_all_apps_for_user()
all_modules = [x["module_name"] for x in all_modules_data]
self.assertIsInstance(all_modules_data, list)
self.assertFalse([x for x in frappe_modules if x not in all_modules])