summaryrefslogtreecommitdiff
path: root/tests/db_functions/math/test_cos.py
diff options
context:
space:
mode:
authorSrinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com>2018-07-01 02:19:20 +0530
committerTim Graham <timograham@gmail.com>2018-09-10 15:08:55 -0400
commit34d6bceec46c5d4234c156ed682573d2e5de474a (patch)
tree7239bb1c2d435f9ddd4caf2e565d0d673f6e9735 /tests/db_functions/math/test_cos.py
parent76dfa834e7ceeca97cd8e3cfa86651a955aa3f0c (diff)
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>
Diffstat (limited to 'tests/db_functions/math/test_cos.py')
-rw-r--r--tests/db_functions/math/test_cos.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/db_functions/math/test_cos.py b/tests/db_functions/math/test_cos.py
index 15975e247d..99cf96620e 100644
--- a/tests/db_functions/math/test_cos.py
+++ b/tests/db_functions/math/test_cos.py
@@ -11,6 +11,11 @@ from ..models import DecimalModel, FloatModel, IntegerModel
class CosTests(TestCase):
+ def test_null(self):
+ IntegerModel.objects.create()
+ obj = IntegerModel.objects.annotate(null_cos=Cos('normal')).first()
+ self.assertIsNone(obj.null_cos)
+
def test_decimal(self):
DecimalModel.objects.create(n1=Decimal('-12.9'), n2=Decimal('0.6'))
obj = DecimalModel.objects.annotate(n1_cos=Cos('n1'), n2_cos=Cos('n2')).first()