mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #29919 -- Fixed RelatedOnlyFieldListFilter crash with reverse relationships.
This commit is contained in:
committed by
Mariusz Felisiak
parent
f3855a8d2d
commit
bc94e3c1a2
@@ -289,3 +289,14 @@ class GetChoicesLimitChoicesToTests(TestCase):
|
||||
self.field.get_choices(include_blank=False, limit_choices_to={}),
|
||||
[self.foo1, self.foo2],
|
||||
)
|
||||
|
||||
def test_get_choices_reverse_related_field(self):
|
||||
field = self.field.remote_field
|
||||
self.assertChoicesEqual(
|
||||
field.get_choices(include_blank=False, limit_choices_to={'b': 'b'}),
|
||||
[self.bar1],
|
||||
)
|
||||
self.assertChoicesEqual(
|
||||
field.get_choices(include_blank=False, limit_choices_to={}),
|
||||
[self.bar1, self.bar2],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user