mirror of
https://github.com/django/django.git
synced 2025-08-01 17:42:56 +00:00
[2.2.x] Simplified test_transform()s in db_functions.math.
Backport of 258110d6cd
from master.
This commit is contained in:
parent
a9ce7e2bcd
commit
b150d99460
16 changed files with 32 additions and 32 deletions
|
@ -49,5 +49,5 @@ class RoundTests(TestCase):
|
|||
with register_lookup(DecimalField, Round):
|
||||
DecimalModel.objects.create(n1=Decimal('2.0'), n2=Decimal('0'))
|
||||
DecimalModel.objects.create(n1=Decimal('-1.0'), n2=Decimal('0'))
|
||||
objs = DecimalModel.objects.filter(n1__round__gt=0)
|
||||
self.assertQuerysetEqual(objs, [Decimal('2.0')], lambda a: a.n1)
|
||||
obj = DecimalModel.objects.filter(n1__round__gt=0).get()
|
||||
self.assertEqual(obj.n1, Decimal('2.0'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue