1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[5.0.x] Fixed #34840 -- Avoided casting string base fields on PostgreSQL.

Thanks Alex Vandiver for the report.

Regression in 09ffc5c121.

Backport of 779cd28acb from main.
This commit is contained in:
Mariusz Felisiak
2023-09-22 06:01:11 +02:00
parent fb5dd118e9
commit 2566f92544
6 changed files with 78 additions and 15 deletions

View File

@@ -1337,6 +1337,16 @@ class LookupTests(TestCase):
with self.assertRaisesMessage(ValueError, msg):
qs.exists()
def test_isnull_textfield(self):
self.assertSequenceEqual(
Author.objects.filter(bio__isnull=True),
[self.au2],
)
self.assertSequenceEqual(
Author.objects.filter(bio__isnull=False),
[self.au1],
)
def test_lookup_rhs(self):
product = Product.objects.create(name="GME", qty_target=5000)
stock_1 = Stock.objects.create(product=product, short=True, qty_available=180)