Refs #9619 -- Added a test that Field.from_db_value() is called on QuerySet.values()
This commit is contained in:
parent
ebd183a18c
commit
9aac99e96d
1
AUTHORS
1
AUTHORS
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue