mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
[2.2.x] Simplified test_transform()s in db_functions.math.
Backport of 258110d6cd from master.
This commit is contained in:
committed by
Tim Graham
parent
a9ce7e2bcd
commit
b150d99460
@@ -50,5 +50,5 @@ class SqrtTests(TestCase):
|
||||
with register_lookup(DecimalField, Sqrt):
|
||||
DecimalModel.objects.create(n1=Decimal('6.0'), n2=Decimal('0'))
|
||||
DecimalModel.objects.create(n1=Decimal('1.0'), n2=Decimal('0'))
|
||||
objs = DecimalModel.objects.filter(n1__sqrt__gt=2)
|
||||
self.assertQuerysetEqual(objs, [Decimal('6.0')], lambda a: a.n1)
|
||||
obj = DecimalModel.objects.filter(n1__sqrt__gt=2).get()
|
||||
self.assertEqual(obj.n1, Decimal('6.0'))
|
||||
|
||||
Reference in New Issue
Block a user