mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
* Fixed #29010 -- Added limit_choices_to support to autocomplete fields. * Fixed #29138 -- Allowed autocomplete fields to target a custom to_field rather than the PK.
This commit is contained in:
@@ -539,13 +539,13 @@ class ForeignKeyRawIdWidgetTest(TestCase):
|
||||
|
||||
w = widgets.ForeignKeyRawIdWidget(rel, widget_admin_site)
|
||||
self.assertHTMLEqual(
|
||||
w.render('test', band.pk, attrs={}),
|
||||
'<input type="text" name="test" value="%(bandpk)s" '
|
||||
w.render('test', band.uuid, attrs={}),
|
||||
'<input type="text" name="test" value="%(banduuid)s" '
|
||||
'class="vForeignKeyRawIdAdminField">'
|
||||
'<a href="/admin_widgets/band/?_to_field=id" class="related-lookup" '
|
||||
'<a href="/admin_widgets/band/?_to_field=uuid" class="related-lookup" '
|
||||
'id="lookup_id_test" title="Lookup"></a> <strong>'
|
||||
'<a href="/admin_widgets/band/%(bandpk)s/change/">Linkin Park</a>'
|
||||
'</strong>' % {'bandpk': band.pk}
|
||||
'</strong>' % {'banduuid': band.uuid, 'bandpk': band.pk}
|
||||
)
|
||||
|
||||
def test_relations_to_non_primary_key(self):
|
||||
|
||||
Reference in New Issue
Block a user