mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
[1.6.x] Fixed #20865 -- Fixed raw_id_fields to work with callable limit_choices_to.
Backport of d53e574676 from master
This commit is contained in:
committed by
Tim Graham
parent
4c90081b5b
commit
e3e0cf8a0f
@@ -226,6 +226,13 @@ class AdminForeignKeyRawIdWidget(DjangoTestCase):
|
||||
self.assertEqual(lookup1, {'color__in': 'red,blue'})
|
||||
self.assertEqual(lookup1, lookup2)
|
||||
|
||||
def test_url_params_from_lookup_dict_callable(self):
|
||||
def my_callable():
|
||||
return 'works'
|
||||
lookup1 = widgets.url_params_from_lookup_dict({'myfield': my_callable})
|
||||
lookup2 = widgets.url_params_from_lookup_dict({'myfield': my_callable()})
|
||||
self.assertEqual(lookup1, lookup2)
|
||||
|
||||
|
||||
class FilteredSelectMultipleWidgetTest(DjangoTestCase):
|
||||
def test_render(self):
|
||||
|
||||
Reference in New Issue
Block a user