From d18f4e717fea0bc558ccaa484caa0304da525fce Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 3 Feb 2022 16:58:59 +0530 Subject: [PATCH] fix(test): Use standard test site for cli invokations --- frappe/tests/test_commands.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frappe/tests/test_commands.py b/frappe/tests/test_commands.py index 18fd3d636f..2efea7d7f9 100644 --- a/frappe/tests/test_commands.py +++ b/frappe/tests/test_commands.py @@ -194,35 +194,35 @@ class TestCommands(BaseTestCommands): "root_password": frappe.conf.root_password, "db_type": frappe.conf.db_type, } - site_data = {"another_site": f"{frappe.local.site}-restore.test", **global_config} + site_data = {"test_site": TEST_SITE, **global_config} for key, value in global_config.items(): if value: self.execute(f"bench set-config {key} {value} -g") self.execute( - "bench new-site {another_site} --admin-password {admin_password} --db-type" + "bench new-site {test_site} --admin-password {admin_password} --db-type" " {db_type}", site_data, ) # test 1: bench restore from full backup - self.execute("bench --site {another_site} backup --ignore-backup-conf", site_data) + self.execute("bench --site {test_site} backup --ignore-backup-conf", site_data) self.execute( - "bench --site {another_site} execute frappe.utils.backups.fetch_latest_backups", + "bench --site {test_site} execute frappe.utils.backups.fetch_latest_backups", site_data, ) site_data.update({"database": json.loads(self.stdout)["database"]}) - self.execute("bench --site {another_site} restore {database}", site_data) + self.execute("bench --site {test_site} restore {database}", site_data) # test 2: restore from partial backup - self.execute("bench --site {another_site} backup --exclude 'ToDo'", site_data) + self.execute("bench --site {test_site} backup --exclude 'ToDo'", site_data) site_data.update({"kw": "\"{'partial':True}\""}) self.execute( - "bench --site {another_site} execute" + "bench --site {test_site} execute" " frappe.utils.backups.fetch_latest_backups --kwargs {kw}", site_data, ) site_data.update({"database": json.loads(self.stdout)["database"]}) - self.execute("bench --site {another_site} restore {database}", site_data) + self.execute("bench --site {test_site} restore {database}", site_data) self.assertEqual(self.returncode, 1) def test_partial_restore(self):