mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Fixed #19151 -- Added missing methods to EmptyQuerySet.
Added values() and values_list() methods to EmptyQuerySet.
This commit is contained in:
parent
d7c6a57d60
commit
b87e2f46c8
2 changed files with 19 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue