Skip to content

Commit

Permalink
[2.2.x] Fixed ForeignKeyRawIdWidgetTest.test_render_unsafe_limit_choi…
Browse files Browse the repository at this point in the history
…ces_to on Python 3.5.
  • Loading branch information
felixxm committed Jul 2, 2020
1 parent 202ac0b commit 5968a23
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/admin_widgets/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,14 @@ def test_proper_manager_for_label_lookup(self):
def test_render_unsafe_limit_choices_to(self):
rel = UnsafeLimitChoicesTo._meta.get_field('band').remote_field
w = widgets.ForeignKeyRawIdWidget(rel, widget_admin_site)
parameters = w.url_parameters()
parameters['name'] = '%22%26%3E%3Cescapeme'
self.assertHTMLEqual(
w.render('test', None),
'<input type="text" name="test" class="vForeignKeyRawIdAdminField">'
'<a href="/admin_widgets/band/?name=%22%26%3E%3Cescapeme&amp;_to_field=id" '
'class="related-lookup" id="lookup_id_test" title="Lookup"></a>'
'<a class="related-lookup" href="/admin_widgets/band/?%s" '
'id="lookup_id_test" title="Lookup"></a>'
% '&amp;'.join('%s=%s' % (k, v) for k, v in parameters.items())
)


Expand Down

0 comments on commit 5968a23

Please sign in to comment.