MCPcopy
hub / github.com/django/django / test_righthand_power

Method test_righthand_power

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

Source from the content-addressed store, hash-verified

1888 self.assertEqual(Number.objects.get(pk=self.n.pk).integer, 27)
1889
1890 def test_righthand_power(self):
1891 # RH Power arithmetic operation on floats and integers
1892 Number.objects.filter(pk=self.n.pk).update(
1893 integer=2 ** F("integer"), float=1.5 ** F("float")
1894 )
1895 self.assertEqual(Number.objects.get(pk=self.n.pk).integer, 4398046511104)
1896 self.assertEqual(
1897 Number.objects.get(pk=self.n.pk).float, Approximate(536.308, places=3)
1898 )
1899
1900
1901class FTimeDeltaTests(TestCase):

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