Kaydet (Commit) 9aac99e9 authored tarafından JensDiemer's avatar JensDiemer Kaydeden (comit) Tim Graham

Refs #9619 -- Added a test that Field.from_db_value() is called on QuerySet.values()

üst ebd183a1
......@@ -325,6 +325,7 @@ answer newbie questions, and generally made Django that much better:
Jeff Hui <jeffkhui@gmail.com>
Jeffrey Gelens <jeffrey@gelens.org>
Jeff Triplett <jeff.triplett@gmail.com>
Jens Diemer <django@htfx.de>
Jens Page
Jeong-Min Lee <falsetru@gmail.com>
Jérémie Blaser <blaserje@gmail.com>
......
......@@ -13,10 +13,14 @@ class FromDBValueTest(TestCase):
instance = CashModel.objects.get()
self.assertIsInstance(instance.cash, Cash)
def test_values(self):
def test_values_list(self):
values_list = CashModel.objects.values_list('cash', flat=True)
self.assertIsInstance(values_list[0], Cash)
def test_values(self):
values = CashModel.objects.values('cash')
self.assertIsInstance(values_list[0]['cash'], Cash)
def test_aggregation(self):
maximum = CashModel.objects.aggregate(m=Max('cash'))['m']
self.assertIsInstance(maximum, Cash)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment