Commit dcfc6b47 authored by Jérome Perrin's avatar Jérome Perrin

Add test for "ValueError: need more than 1 value to unpack" bug when trying to install

business template with a dependency >= a given version.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16016 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dc284e58
...@@ -4198,6 +4198,9 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -4198,6 +4198,9 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
def test_getInstalledBusinessTemplate(self):
self.assertNotEquals(None, self.getPortal()\
.portal_templates.getInstalledBusinessTemplate('erp5_core'))
def test_CompareVersions(self): def test_CompareVersions(self):
"""Tests compare version on template tool. """ """Tests compare version on template tool. """
...@@ -4220,6 +4223,26 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -4220,6 +4223,26 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
self.assertTrue(compareVersionStrings('1.1', '> 1.0')) self.assertTrue(compareVersionStrings('1.1', '> 1.0'))
self.assertFalse(compareVersionStrings('1.1rc1', '= 1.0')) self.assertFalse(compareVersionStrings('1.1rc1', '= 1.0'))
self.assertFalse(compareVersionStrings('1.0rc1', '> 1.0')) self.assertFalse(compareVersionStrings('1.0rc1', '> 1.0'))
self.assertFalse(compareVersionStrings('1.0rc1', '>= 1.0'))
self.assertTrue(compareVersionStrings('1.0rc1', '>= 1.0rc1'))
def test_checkDependencies(self):
from Products.ERP5Type.Document.BusinessTemplate import \
BusinessTemplateMissingDependency
template_tool = self.getPortal().portal_templates
erp5_core_version = template_tool.getInstalledBusinessTemplate(
'erp5_core').getVersion()
bt5 = self.getPortal().portal_templates.newContent(
portal_type='Business Template',
dependency_list=['erp5_core (>= %s)' % erp5_core_version])
self.assertEquals(None, bt5.checkDependencies())
bt5.setDependencyList(['erp5_core (> %s)' % erp5_core_version])
self.assertRaises(BusinessTemplateMissingDependency, bt5.checkDependencies)
bt5.setDependencyList(['not_exists (= 1.0)'])
self.assertRaises(BusinessTemplateMissingDependency, bt5.checkDependencies)
if __name__ == '__main__': if __name__ == '__main__':
......
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