Commit 9d7e780f authored by Jérome Perrin's avatar Jérome Perrin

coding style: check that we can run upgrader

We want to detect business templates with problems that would prevent to
run upgrader.
parent 801ff6ab
......@@ -44,11 +44,13 @@ class CodingStyleTest(CodingStyleTestCase, testXHTML.TestXHTMLMixin):
def getBusinessTemplateList(self):
# install erp5_administration to check with tools from erp5_administration
# and erp5_upgrader for CodingStyleTestCase.test_run_upgrader
# XXX also install erp5_full_text_myisam_catalog to workaround missing test
# dependencies and the fact that test dependencies are not checked
# recursively.
return (
'erp5_administration',
'erp5_upgrader',
'erp5_full_text_myisam_catalog',
self.tested_business_template)
......
......@@ -125,3 +125,32 @@ class CodingStyleTestCase(ERP5TypeTestCase):
self.maxDiff = None
self.assertEqual(existing_files, new_files)
def test_run_upgrader(self):
# Check that pre and post upgrade do not raise problems.
# We dont check upgrade step, because upgrader by default want to
# uninstall business templates.
self.portal.portal_alarms.upgrader_check_pre_upgrade.activeSense(fixit=True)
self.tic()
self.portal.portal_alarms.upgrader_check_pre_upgrade.activeSense()
self.tic()
self.assertFalse(
self.portal.portal_alarms.upgrader_check_pre_upgrade.sense(),
[
'\n'.join(x.detail) for x in self.portal.portal_alarms
.upgrader_check_post_upgrade.Alarm_getReportResultList()
],
)
self.portal.portal_alarms.upgrader_check_post_upgrade.activeSense(
fixit=True)
self.tic()
self.portal.portal_alarms.upgrader_check_post_upgrade.activeSense()
self.tic()
self.assertFalse(
self.portal.portal_alarms.upgrader_check_post_upgrade.sense(),
[
'\n'.join(x.detail) for x in self.portal.portal_alarms
.upgrader_check_post_upgrade.Alarm_getReportResultList()
],
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment