[PKG-Openstack-devel] Bug#755651: [openstack-dev] [horizon] Support for Django 1.7: there's a bit of work, though it looks fixable to me...

Raphael Hertzog hertzog at debian.org
Wed Sep 10 20:42:09 UTC 2014


[ I'm not subscribed to openstack-devel, please cc me ]

On Tue, 05 Aug 2014, Thomas Goirand wrote:
> I'm now down to only a single error not solved:
> 
> ======================================================================
> FAIL: test_update_project_when_default_role_does_not_exist
> (openstack_dashboard.dashboards.admin.projects.tests.UpdateProjectWorkflowTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/openstack_dashboard/test/helpers.py",
> line 83, in instance_stub_out
>     return fn(self, *args, **kwargs)
>   File
> "/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/openstack_dashboard/dashboards/admin/projects/tests.py",
> line 1458, in test_update_project_when_default_role_does_not_exist
>     self.client.get(url)
> AssertionError: NotFound not raised
> 
> Any idea?

I looked further into this and in fact the exceptions is caught by the
template rendering code (IncludeNode.render() in
django/template/loader_tags.py while processing the include of
'horizon/common/_workflow.html' and to be more precise the processing of
'{% if step.has_required_fields %}' is the exact place where the exception
is fired). I can get the test to pass by changing the Django setting
TEMPLATE_DEBUG to True.

Django 1.6 has a slightly different code here and doesn't intercept
it (I'm not sure why, but I did two parallel step by step execution
with pdb to verify this).

But such a setting is not appropriate for production usage and somehow I
expect horizon to rely on the fact that the exception can be caught in
some upper level. So I'm not quite sure what to suggest here.

The expected behaviour is not clear to me and relying on exception
propagation from code executed indirectly in template rendering seems
bad design from the start. 

That said the consequences of this failing test is "just" that we get a
page without any useful content instead of an "internal server error".
Not sure that it matters much either...

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/



More information about the Openstack-devel mailing list