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

Fixed #34840 -- Avoided casting string base fields on PostgreSQL.

Thanks Alex Vandiver for the report.

Regression in 09ffc5c121.
This commit is contained in:
Mariusz Felisiak
2023-09-22 06:01:11 +02:00
committed by GitHub
parent 78b5c90753
commit 779cd28acb
6 changed files with 78 additions and 12 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)