Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Hsin-Yu Chien
edx-platform-release
Commits
85374465
Unverified
Commit
85374465
authored
4 years ago
by
Manjinder Singh
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Changing test to work with django 2.1 and higher (#23573)
This is part of the django 2 upgrade
parent
26f0176d
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/api_admin/tests/test_forms.py
+6
-2
6 additions, 2 deletions
openedx/core/djangoapps/api_admin/tests/test_forms.py
with
6 additions
and
2 deletions
openedx/core/djangoapps/api_admin/tests/test_forms.py
+
6
−
2
View file @
85374465
#pylint: disable=missing-docstring
import
django
import
ddt
from
django.test
import
TestCase
...
...
@@ -34,9 +34,13 @@ class ViewersWidgetTest(TestCase):
"""
dummy_string_value
=
'
staff, verified
'
input_field_name
=
'
viewers
'
expected_widget_html
=
u
'
<input type=
"
text
"
name=
"
{input_field_name}
"
value=
"
{serialized_value}
"
/>
'
.
format
(
extra_formating
=
''
if
django
.
VERSION
<
(
2
,
1
):
extra_formating
=
'
/
'
expected_widget_html
=
'
<input type=
"
text
"
name=
"
{input_field_name}
"
value=
"
{serialized_value}
"
{extra_formating}>
'
.
format
(
input_field_name
=
input_field_name
,
serialized_value
=
dummy_string_value
,
extra_formating
=
extra_formating
,
)
output
=
self
.
widget
.
render
(
name
=
input_field_name
,
value
=
dummy_string_value
)
self
.
assertEqual
(
expected_widget_html
,
output
)
...
...
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