Browse Source

[ADD] test purging tables

pull/469/head
Holger Brunn 8 years ago
parent
commit
faa4428eb0
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

@ -64,3 +64,11 @@ class TestDatabaseCleanup(TransactionCase):
self.assertFalse(self.env['ir.module.module'].search([
('name', '=', 'database_cleanup_test'),
]))
# 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()
with self.assertRaises(ProgrammingError):
with self.registry.cursor() as cr:
self.env.cr.execute('select * from database_cleanup_test')
Loading…
Cancel
Save