summaryrefslogtreecommitdiff
path: root/tests/model_fields
diff options
context:
space:
mode:
Diffstat (limited to 'tests/model_fields')
-rw-r--r--tests/model_fields/tests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py
index 206ac8c84c..0d6e930b06 100644
--- a/tests/model_fields/tests.py
+++ b/tests/model_fields/tests.py
@@ -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],
+ )