From 9aac99e96d100b34b6daa3a137531eff4f17076e Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Wed, 17 Jun 2015 15:42:23 +0200 Subject: [PATCH] Refs #9619 -- Added a test that Field.from_db_value() is called on QuerySet.values() --- AUTHORS | 1 + tests/from_db_value/tests.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 6d0dd6c1ba..cd71b7b3b3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -325,6 +325,7 @@ answer newbie questions, and generally made Django that much better: Jeff Hui Jeffrey Gelens Jeff Triplett + Jens Diemer Jens Page Jeong-Min Lee Jérémie Blaser diff --git a/tests/from_db_value/tests.py b/tests/from_db_value/tests.py index 10b9e1556e..2f43bb9065 100644 --- a/tests/from_db_value/tests.py +++ b/tests/from_db_value/tests.py @@ -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)