summaryrefslogtreecommitdiff
path: root/tests/admin_widgets/tests.py
diff options
context:
space:
mode:
authorJohannes Maron <info@johanneshoppe.com>2021-01-12 11:37:38 +0100
committerGitHub <noreply@github.com>2021-01-12 11:37:38 +0100
commit3071660acfbdf4b5c59457c8e9dc345d5e8894c5 (patch)
tree78b95d329ff10f4e0cd1c7b4d237d78c29b0d0bb /tests/admin_widgets/tests.py
parentba3fb2e4d0aca26f6ea37d7e31488ad09043f89d (diff)
Fixed #29010, Fixed #29138 -- Added limit_choices_to and to_field support to autocomplete fields.
* 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.
Diffstat (limited to 'tests/admin_widgets/tests.py')
-rw-r--r--tests/admin_widgets/tests.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py
index 334a534907..3c41d9cdfa 100644
--- a/tests/admin_widgets/tests.py
+++ b/tests/admin_widgets/tests.py
@@ -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>&nbsp;<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):