Browse Source

[FIX] only purge our own table

pull/1030/head
Holger Brunn 7 years ago
parent
commit
63f73478cb
No known key found for this signature in database GPG Key ID: 1C9760FECA3AE18
  1. 8
      database_cleanup/tests/test_database_cleanup.py

8
database_cleanup/tests/test_database_cleanup.py

@ -74,7 +74,13 @@ class TestDatabaseCleanup(TransactionCase):
# create an orphaned table
self.env.cr.execute('create table database_cleanup_test (test int)')
purge_tables = self.env['cleanup.purge.wizard.table'].create({})
purge_tables.purge_all()
self.assertIn(
'database_cleanup_test',
purge_tables.purge_line_ids.mapped('name')
)
purge_tables.purge_line_ids.filtered(
lambda x: x.name == 'database_cleanup_test'
).purge()
with self.assertRaises(ProgrammingError):
with self.registry.cursor() as cr:
self.env.cr.execute('select * from database_cleanup_test')
Loading…
Cancel
Save