mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #29500 -- Fixed SQLite function crashes on null values.
Co-authored-by: Srinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com> Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
This commit is contained in:
committed by
Tim Graham
parent
76dfa834e7
commit
34d6bceec4
@@ -9,6 +9,15 @@ from ..models import DecimalModel, FloatModel, IntegerModel
|
||||
|
||||
class LogTests(TestCase):
|
||||
|
||||
def test_null(self):
|
||||
IntegerModel.objects.create(big=100)
|
||||
obj = IntegerModel.objects.annotate(
|
||||
null_log_small=Log('small', 'normal'),
|
||||
null_log_normal=Log('normal', 'big'),
|
||||
).first()
|
||||
self.assertIsNone(obj.null_log_small)
|
||||
self.assertIsNone(obj.null_log_normal)
|
||||
|
||||
def test_decimal(self):
|
||||
DecimalModel.objects.create(n1=Decimal('12.9'), n2=Decimal('3.6'))
|
||||
obj = DecimalModel.objects.annotate(n_log=Log('n1', 'n2')).first()
|
||||
|
||||
Reference in New Issue
Block a user