MCPcopy
hub / github.com/django/django / test_decimal_parameter

Method test_decimal_parameter

tests/raw_query/tests.py:421–426  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

419 )
420
421 def test_decimal_parameter(self):
422 c = Coffee.objects.create(brand="starbucks", price=20.5)
423 qs = Coffee.objects.raw(
424 "SELECT * FROM raw_query_coffee WHERE price >= %s", params=[Decimal(20)]
425 )
426 self.assertEqual(list(qs), [c])
427
428 def test_result_caching(self):
429 with self.assertNumQueries(1):

Callers

nothing calls this directly

Calls 2

createMethod · 0.45
rawMethod · 0.45

Tested by

no test coverage detected