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

Merge branch 'make_view_edit_view_into_tab' into fix_upload_button

parents e57d3b65 6b47f1e0
Branches
No related tags found
2 merge requests!26Make view edit view into tab,!25Fix upload button
......@@ -38,10 +38,10 @@ def _get_rendering_details(context, tab_instance):
else:
settings = {} # TODO: json field doesn't default to this?
tab_details = tab.get_context_data(**settings)
request = context.get('request')
tab_details = tab.get_context_data(request, **settings)
return template_name, tab_details, request
......
......@@ -142,3 +142,24 @@ def test_settings_passed_to_widget_get_context_data(render_to_string_method):
_, kwargs = mock_get_context.call_args
assert kwargs['columns'] == columns
@pytest.mark.django_db
@patch(render_to_string_method)
def test_request_passed_to_widget_get_context_data(render_to_string_method):
with patch.object(BasicHtmlTab, 'get_context_data') as mock_get_context:
tab = BasicHtmlTab()
register_tab('basic-html-tab', tab)
page = TabbedPageFactory()
tab_instance = TabInstanceFactory(
page=page,
view_name='basic-html-tab')
request = Mock()
context = {'request': request}
render_tab(context, tab_instance)
args, kwargs = mock_get_context.call_args
assert args[0] == request
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment