"""
with self.assertRaises(ValueError) as ve:
HomeStaticTemplateHelpers.get_qweb_templates(addons=self._get_module_names(), debug=True)
self.assertEqual(
str(ve.exception),
'No template found to inherit from. Module module_2 and template name template_2_2'
)
def _sick_script(self, nMod, nFilePerMod, nTemplatePerFile, stepInheritInModule=2, stepInheritPreviousModule=3):
"""
Make a sick amount of templates to test perf
nMod modules
each module: has nFilesPerModule files, each of which contains nTemplatePerFile templates
"""
self.modules = []
self.template_files = {}
number_templates = 0
for m in range(nMod):
for f in range(nFilePerMod):
mname = 'mod_%s' % m
fname = 'mod_%s_file_%s' % (m, f)
self.modules.append((fname, None, mname))
_file = ''
for t in range(nTemplatePerFile):
_template = ''
if t % stepInheritInModule or t % stepInheritPreviousModule or t == 0:
_template += """
Parent
"""
elif not t % stepInheritInModule and t >= 1:
_template += """
Sick XPath
"""
elif not t % stepInheritPreviousModule and m >= 1:
_template += """