MCPcopy
hub / github.com/django/django / test_transform

Method test_transform

tests/db_functions/math/test_cos.py:48–53  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

46 self.assertAlmostEqual(obj.big_cos, math.cos(obj.big))
47
48 def test_transform(self):
49 with register_lookup(DecimalField, Cos):
50 DecimalModel.objects.create(n1=Decimal("-8.0"), n2=Decimal("0"))
51 DecimalModel.objects.create(n1=Decimal("3.14"), n2=Decimal("0"))
52 obj = DecimalModel.objects.filter(n1__cos__gt=-0.2).get()
53 self.assertEqual(obj.n1, Decimal("-8.0"))

Callers

nothing calls this directly

Calls 4

register_lookupFunction · 0.90
createMethod · 0.45
getMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected