MCPcopy
hub / github.com/django/django / test_float

Method test_float

tests/db_functions/math/test_mod.py:26–30  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

24 self.assertAlmostEqual(obj.n_mod, Decimal(math.fmod(obj.n1, obj.n2)))
25
26 def test_float(self):
27 FloatModel.objects.create(f1=-25, f2=0.33)
28 obj = FloatModel.objects.annotate(f_mod=Mod("f1", "f2")).first()
29 self.assertIsInstance(obj.f_mod, float)
30 self.assertAlmostEqual(obj.f_mod, math.fmod(obj.f1, obj.f2))
31
32 def test_integer(self):
33 IntegerModel.objects.create(small=20, normal=15, big=1)

Callers

nothing calls this directly

Calls 4

ModClass · 0.90
firstMethod · 0.80
annotateMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected