diff --git a/tests/generic_relations/tests.py b/tests/generic_relations/tests.py
index 7c0db95908..683efaddfb 100644
a
|
b
|
class GenericRelationsTests(TestCase):
|
564 | 564 | for tag in tags: |
565 | 565 | self.assertSequenceEqual(tag.content_object.tags.all(), [tag]) |
566 | 566 | |
| 567 | def test_prefetch_related_custom_object_id(self): |
| 568 | tiger = Animal.objects.create(common_name='tiger') |
| 569 | cheetah = Animal.objects.create(common_name='cheetah') |
| 570 | Comparison.objects.create( |
| 571 | first_obj=cheetah, other_obj=tiger, comparative='faster', |
| 572 | ) |
| 573 | Comparison.objects.create( |
| 574 | first_obj=tiger, other_obj=cheetah, comparative='cooler', |
| 575 | ) |
| 576 | qs = Comparison.objects.prefetch_related('first_obj__comparisons') |
| 577 | for comparison in qs: |
| 578 | self.assertSequenceEqual(comparison.first_obj.comparisons.all(), [comparison]) |
| 579 | |
567 | 580 | |
568 | 581 | class ProxyRelatedModelTest(TestCase): |
569 | 582 | def test_default_behavior(self): |