From cb44492febb27deb167af374c4c76c5bde3f357d Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Tue, 3 Nov 2020 13:55:26 +0530 Subject: [PATCH] test: Added tests for bench remove-from-installed-apps --- frappe/tests/test_commands.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/frappe/tests/test_commands.py b/frappe/tests/test_commands.py index 62db8fc852..4e02de795a 100644 --- a/frappe/tests/test_commands.py +++ b/frappe/tests/test_commands.py @@ -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)