Browse Source

chore: Add test for archiving site before dropping

version-14
ChillarAnand 3 years ago
parent
commit
8191fafa58
1 changed files with 18 additions and 0 deletions
  1. +18
    -0
      frappe/tests/test_commands.py

+ 18
- 0
frappe/tests/test_commands.py 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):


Loading…
Cancel
Save