def add_to_installed_apps(*apps): from frappe.installer import add_to_installed_apps frappe.connect() all_apps = frappe.get_all_apps(with_frappe=True) for each in apps: if each in all_apps: add_to_installed_apps(each, rebuild_website=False) frappe.destroy()
def add_to_installed_apps(*apps): from frappe.installer import add_to_installed_apps frappe.connect() all_apps = frappe.get_all_apps(with_frappe=True) for each in apps: if each in all_apps: add_to_installed_apps(each, rebuild_sitemap=False) frappe.destroy()
def test_remove_from_installed_apps(self): app = "test_remove_app" add_to_installed_apps(app) # check: confirm that add_to_installed_apps added the app in the default self.execute("bench --site {site} list-apps") self.assertIn(app, self.stdout) # test 1: remove app from installed_apps global default self.execute("bench --site {site} remove-from-installed-apps {app}", {"app": app}) self.assertEquals(self.returncode, 0) self.execute("bench --site {site} list-apps") self.assertNotIn(app, self.stdout)
def migrate(site): validate(site) frappe.init(site=site, sites_path=sites_path) frappe.connect() add_to_installed_apps('frappe', rebuild_website=False) add_to_installed_apps('erpnext', rebuild_website=False) add_to_installed_apps('shopping_cart', rebuild_website=False) latest()