summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJan Bednařík <jan.bednarik@gmail.com>2012-10-21 00:11:16 +0200
committerJan Bednařík <jan.bednarik@gmail.com>2012-10-21 00:19:38 +0200
commitb87e2f46c80d15abcda0e181ab894fb938ceb12f (patch)
tree19625465f3c257fc7ae04fff54af6250e5c5f6a0 /tests
parentd7c6a57d606bbb8185f9215ffce4c0516a9ae438 (diff)
Fixed #19151 -- Added missing methods to EmptyQuerySet.
Added values() and values_list() methods to EmptyQuerySet.
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/queries/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py
index 71ac107486..c2a4ad1caf 100644
--- a/tests/regressiontests/queries/tests.py
+++ b/tests/regressiontests/queries/tests.py
@@ -1698,6 +1698,13 @@ class EmptyQuerySetTests(TestCase):
[]
)
+ def test_ticket_19151(self):
+ # #19151 -- Calling .values() or .values_list() on an EmptyQuerySet
+ # should return EmptyQuerySet and not cause an error.
+ q = EmptyQuerySet()
+ self.assertQuerysetEqual(q.values(), [])
+ self.assertQuerysetEqual(q.values_list(), [])
+
class ValuesQuerysetTests(BaseQuerysetTest):
def test_flat_values_lits(self):