Skip to content
Snippets Groups Projects
Commit 99292f40 authored by Martin Burchell's avatar Martin Burchell
Browse files

Fixed bug where wrong property was being read

use view_name instead of name when getting tab out of the registry
parent b097eaa2
No related branches found
No related tags found
2 merge requests!23Tabbed view header styling,!22Tabbed page
......@@ -9,7 +9,7 @@ register = template.Library()
@register.simple_tag(takes_context=True)
def render_tab(context, tab_instance):
tab = get_tab(tab_instance.name)
tab = get_tab(tab_instance.view_name)
template_name = tab.template_name
......
......@@ -25,7 +25,7 @@ def test_uses_template_name(mock_render):
register_tab('test-tab', tab)
page = TabbedPageFactory()
tab_instance = TabInstanceFactory(page=page, name='test-tab')
tab_instance = TabInstanceFactory(page=page, view_name='test-tab')
render_tab(None, tab_instance)
......@@ -43,7 +43,7 @@ def test_uses_context(mock_render):
page = TabbedPageFactory()
tab_instance = TabInstanceFactory(page=page, name='test-tab')
tab_instance = TabInstanceFactory(page=page, view_name='test-tab')
render_tab(None, tab_instance)
......@@ -58,7 +58,7 @@ def test_uses_request(mock_render):
register_tab('test-tab', tab)
page = TabbedPageFactory()
tab_instance = TabInstanceFactory(page=page, name='test-tab')
tab_instance = TabInstanceFactory(page=page, view_name='test-tab')
request = 'a request'
context = {'request': request}
......@@ -79,7 +79,7 @@ def test_settings_passed_to_widget_get_context_data(render_to_string_method):
columns = ['body', 'timestamp', 'network_provider']
settings = {'columns': columns}
tab_instance = TabInstanceFactory(page=page,
name='test-tab',
view_name='test-tab',
settings=settings)
render_tab(None, tab_instance)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment