MCPcopy
hub / github.com/django/django / test_lefthand_subtraction

Method test_lefthand_subtraction

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

Source from the content-addressed store, hash-verified

1727 )
1728
1729 def test_lefthand_subtraction(self):
1730 # LH Subtraction of floats and integers
1731 Number.objects.filter(pk=self.n.pk).update(
1732 integer=F("integer") - 15, float=F("float") - 42.7
1733 )
1734
1735 self.assertEqual(Number.objects.get(pk=self.n.pk).integer, 27)
1736 self.assertEqual(
1737 Number.objects.get(pk=self.n.pk).float, Approximate(-27.200, places=3)
1738 )
1739
1740 def test_lefthand_multiplication(self):
1741 # Multiplication 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