mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #20865 -- Fixed raw_id_fields to work with callable limit_choices_to.
This commit is contained in:
parent
709cd2c4b7
commit
d53e574676
2 changed files with 10 additions and 1 deletions
|
@ -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):
|
||||
|
@ -915,4 +922,4 @@ class AdminRawIdWidgetSeleniumChromeTests(AdminRawIdWidgetSeleniumFirefoxTests):
|
|||
webdriver_class = 'selenium.webdriver.chrome.webdriver.WebDriver'
|
||||
|
||||
class AdminRawIdWidgetSeleniumIETests(AdminRawIdWidgetSeleniumFirefoxTests):
|
||||
webdriver_class = 'selenium.webdriver.ie.webdriver.WebDriver'
|
||||
webdriver_class = 'selenium.webdriver.ie.webdriver.WebDriver'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue