Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
internewshid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aptivate
client-projects
internewshid
Commits
373dfef6
Commit
373dfef6
authored
9 years ago
by
Martin Burchell
Browse files
Options
Downloads
Plain Diff
Merge branch 'make_view_edit_view_into_tab' into fix_upload_button
parents
e57d3b65
6b47f1e0
Branches
Branches containing commit
No related tags found
2 merge requests
!26
Make view edit view into tab
,
!25
Fix upload button
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
django/website/tabbed_page/templatetags/render_tab.py
+2
-2
2 additions, 2 deletions
django/website/tabbed_page/templatetags/render_tab.py
django/website/tabbed_page/tests/render_tests.py
+21
-0
21 additions, 0 deletions
django/website/tabbed_page/tests/render_tests.py
with
23 additions
and
2 deletions
django/website/tabbed_page/templatetags/render_tab.py
+
2
−
2
View file @
373dfef6
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
django/website/tabbed_page/tests/render_tests.py
+
21
−
0
View file @
373dfef6
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment