Skip to content
Merged
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
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ env:
matrix:
- LINT_CHECK="1"
- TRANSIFEX="1"
- TESTS="1" ODOO_REPO="odoo/odoo" EXCLUDE=database_cleanup
- TESTS="1" ODOO_REPO="OCA/OCB" EXCLUDE=database_cleanup
- TESTS="1" ODOO_REPO="odoo/odoo" INCLUDE=database_cleanup
- TESTS="1" ODOO_REPO="OCA/OCB" INCLUDE=database_cleanup
- TESTS="1" ODOO_REPO="odoo/odoo"
- TESTS="1" ODOO_REPO="OCA/OCB"

virtualenv:
system_site_packages: true
Expand Down
6 changes: 6 additions & 0 deletions database_cleanup/tests/test_database_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from psycopg2 import ProgrammingError
from openerp.modules.registry import RegistryManager
from openerp.tools import config
from openerp.tests.common import TransactionCase

Expand Down Expand Up @@ -57,13 +58,18 @@ def test_database_cleanup(self):
})
purge_modules = self.env['cleanup.purge.wizard.module'].create({})
# this reloads our registry, and we don't want to run tests twice
# we also need the original registry for further tests, so save a
# reference to it
original_registry = RegistryManager.registries[self.env.cr.dbname]
config.options['test_enable'] = False
purge_modules.purge_all()
config.options['test_enable'] = True
# must be removed by the wizard
self.assertFalse(self.env['ir.module.module'].search([
('name', '=', 'database_cleanup_test'),
]))
# reset afterwards
RegistryManager.registries[self.env.cr.dbname] = original_registry

# create an orphaned table
self.env.cr.execute('create table database_cleanup_test (test int)')
Expand Down