Holger Brunn
7 years ago
No known key found for this signature in database
GPG Key ID: 1C9760FECA3AE18
1 changed files with
7 additions and
1 deletions
-
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') |