Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions database_cleanup/models/purge_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ def find(self):
continue
res.append((0, 0, {"name": module.name}))

purge_lines.purge()

if not res:
raise UserError(_("No modules found to purge"))
return res
Expand Down
12 changes: 9 additions & 3 deletions database_cleanup/tests/test_database_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,27 @@ def keep_registry():

with keep_registry(), mute_logger("odoo.modules.graph", "odoo.modules.loading"):
purge_modules = self.env["cleanup.purge.wizard.module"].create({})
# this module should be purged already during default_get
self.assertFalse(
# no modules are purged during default_get
self.assertTrue(
self.env["ir.module.module"].search(
[("name", "=", "database_cleanup_test_uninstalled")]
)
)

with keep_registry(), mute_logger("odoo.modules.graph", "odoo.modules.loading"):
purge_modules.purge_all()
# must be removed by the wizard
# installed modules must be removed by the wizard
self.assertFalse(
self.env["ir.module.module"].search(
[("name", "=", "database_cleanup_test")]
)
)
# uninstalled modules must be removed by the wizard
self.assertFalse(
self.env["ir.module.module"].search(
[("name", "=", "database_cleanup_test_uninstalled")]
)
)

def tearDown(self):
with self.registry.cursor() as cr2:
Expand Down