mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #15673 -- Allow limit_choices_to to use a tuple for __in filters. Thanks, EnTeQuAk.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16078 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -8,7 +8,8 @@ from django.contrib import admin
|
||||
from django.contrib.admin import widgets
|
||||
from django.contrib.admin.widgets import (FilteredSelectMultiple,
|
||||
AdminSplitDateTime, AdminFileWidget, ForeignKeyRawIdWidget, AdminRadioSelect,
|
||||
RelatedFieldWidgetWrapper, ManyToManyRawIdWidget)
|
||||
RelatedFieldWidgetWrapper, ManyToManyRawIdWidget,
|
||||
url_params_from_lookup_dict)
|
||||
from django.core.files.storage import default_storage
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.db.models import DateField
|
||||
@@ -180,6 +181,12 @@ class AdminForeignKeyRawIdWidget(DjangoTestCase):
|
||||
self.assertContains(response,
|
||||
'Select a valid choice. That choice is not one of the available choices.')
|
||||
|
||||
def test_url_params_from_lookup_dict_any_iterable(self):
|
||||
lookup1 = url_params_from_lookup_dict({'color__in': ('red', 'blue')})
|
||||
lookup2 = url_params_from_lookup_dict({'color__in': ['red', 'blue']})
|
||||
self.assertEqual(lookup1, {'color__in': 'red,blue'})
|
||||
self.assertEqual(lookup1, lookup2)
|
||||
|
||||
|
||||
class FilteredSelectMultipleWidgetTest(TestCase):
|
||||
def test_render(self):
|
||||
|
||||
Reference in New Issue
Block a user