MCPcopy
hub / github.com/django/django / test_update

Method test_update

tests/db_functions/comparison/test_greatest.py:88–92  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

86 self.assertEqual(authors.first().highest_age, 50)
87
88 def test_update(self):
89 author = Author.objects.create(name="James Smith", goes_by="Jim")
90 Author.objects.update(alias=Greatest("name", "goes_by"))
91 author.refresh_from_db()
92 self.assertEqual(author.alias, "Jim")
93
94 def test_decimal_filter(self):
95 obj = DecimalModel.objects.create(n1=Decimal("1.1"), n2=Decimal("1.2"))

Callers

nothing calls this directly

Calls 4

GreatestClass · 0.90
createMethod · 0.45
updateMethod · 0.45
refresh_from_dbMethod · 0.45

Tested by

no test coverage detected