mirror of
https://github.com/django/django.git
synced 2025-09-08 03:30:48 +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:
parent
76dfa834e7
commit
34d6bceec4
29 changed files with 272 additions and 38 deletions
|
@ -9,6 +9,15 @@ from ..models import DecimalModel, FloatModel, IntegerModel
|
|||
|
||||
class ModTests(TestCase):
|
||||
|
||||
def test_null(self):
|
||||
IntegerModel.objects.create(big=100)
|
||||
obj = IntegerModel.objects.annotate(
|
||||
null_mod_small=Mod('small', 'normal'),
|
||||
null_mod_normal=Mod('normal', 'big'),
|
||||
).first()
|
||||
self.assertIsNone(obj.null_mod_small)
|
||||
self.assertIsNone(obj.null_mod_normal)
|
||||
|
||||
def test_decimal(self):
|
||||
DecimalModel.objects.create(n1=Decimal('-9.9'), n2=Decimal('4.6'))
|
||||
obj = DecimalModel.objects.annotate(n_mod=Mod('n1', 'n2')).first()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue