Merge pull request #15464 from ChillarAnand/archive

test: Test case for archiving site before dropping
This commit is contained in:
mergify[bot] 2021-12-29 03:54:37 +00:00 committed by GitHub
commit 5793b3ce52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -474,6 +474,24 @@ class TestCommands(BaseTestCommands):
# cleanup
shutil.rmtree(test_app_path)
def disable_test_bench_drop_site_should_archive_site(self):
site = 'test_site.localhost'
self.execute(
f"bench new-site {site} --force --verbose --admin-password {frappe.conf.admin_password} "
f"--mariadb-root-password {frappe.conf.root_password}"
)
self.assertEqual(self.returncode, 0)
self.execute(f"bench drop-site {site} --force --root-password {frappe.conf.root_password}")
self.assertEqual(self.returncode, 0)
bench_path = frappe.utils.get_bench_path()
site_directory = os.path.join(bench_path, f'sites/{site}')
self.assertFalse(os.path.exists(site_directory))
archive_directory = os.path.join(bench_path, f'archived/sites/{site}')
self.assertTrue(os.path.exists(archive_directory))
class RemoveAppUnitTests(unittest.TestCase):
def test_delete_modules(self):