Skip to content

Commit

Permalink
test: Added tests for bench remove-from-installed-apps
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Nov 3, 2020
1 parent 823aec2 commit cb44492
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion frappe/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def test_backup(self):
self.execute("bench --site {site} backup --verbose")
self.assertEquals(self.returncode, 0)


def test_recorder(self):
frappe.recorder.stop()

Expand All @@ -132,3 +131,17 @@ def test_recorder(self):
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)

0 comments on commit cb44492

Please sign in to comment.