mirror of
https://github.com/django/django.git
synced 2025-12-04 00:55:36 +00:00
Fixed #16055 -- Fixed crash when filtering against char/text GenericRelation relation on PostgreSQL.
This commit is contained in:
parent
594fcc2b74
commit
9bbf97bcdb
11 changed files with 117 additions and 13 deletions
|
|
@ -72,6 +72,20 @@ class GenericRelationTests(TestCase):
|
|||
TextLink.objects.create(content_object=oddrel)
|
||||
oddrel.delete()
|
||||
|
||||
def test_charlink_filter(self):
|
||||
oddrel = OddRelation1.objects.create(name="clink")
|
||||
CharLink.objects.create(content_object=oddrel, value="value")
|
||||
self.assertSequenceEqual(
|
||||
OddRelation1.objects.filter(clinks__value="value"), [oddrel]
|
||||
)
|
||||
|
||||
def test_textlink_filter(self):
|
||||
oddrel = OddRelation2.objects.create(name="clink")
|
||||
TextLink.objects.create(content_object=oddrel, value="value")
|
||||
self.assertSequenceEqual(
|
||||
OddRelation2.objects.filter(tlinks__value="value"), [oddrel]
|
||||
)
|
||||
|
||||
def test_coerce_object_id_remote_field_cache_persistence(self):
|
||||
restaurant = Restaurant.objects.create()
|
||||
CharLink.objects.create(content_object=restaurant)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue