test: Added tests for bench remove-from-installed-apps

This commit is contained in:
Gavin D'souza 2020-11-03 13:55:26 +05:30
parent 823aec2d87
commit cb44492feb

View file

@ -121,7 +121,6 @@ class TestCommands(BaseTestCommands):
self.execute("bench --site {site} backup --verbose")
self.assertEquals(self.returncode, 0)
def test_recorder(self):
frappe.recorder.stop()
@ -132,3 +131,17 @@ class TestCommands(BaseTestCommands):
self.execute("bench --site {site} stop-recording")
frappe.local.cache = {}
self.assertEqual(frappe.recorder.status(), False)
def test_remove_from_installed_apps(self):
from frappe.installer import add_to_installed_apps
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.execute("bench --site {site} list-apps")
self.assertNotIn(app, self.stdout)