MCPcopy
hub / github.com/django/django / test_lefthand_addition

Method test_lefthand_addition

tests/expressions/tests.py:1718–1727  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1716 cls.n1 = Number.objects.create(integer=-42, float=-15.5)
1717
1718 def test_lefthand_addition(self):
1719 # LH Addition of floats and integers
1720 Number.objects.filter(pk=self.n.pk).update(
1721 integer=F("integer") + 15, float=F("float") + 42.7
1722 )
1723
1724 self.assertEqual(Number.objects.get(pk=self.n.pk).integer, 57)
1725 self.assertEqual(
1726 Number.objects.get(pk=self.n.pk).float, Approximate(58.200, places=3)
1727 )
1728
1729 def test_lefthand_subtraction(self):
1730 # LH Subtraction of floats and integers

Callers

nothing calls this directly

Calls 5

FClass · 0.90
ApproximateClass · 0.90
updateMethod · 0.45
filterMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected