Fixed #22550 -- Prohibited QuerySet.last()/reverse() after slicing.

This commit is contained in:
Matthias Erll 2014-05-17 14:59:57 +02:00 committed by Tim Graham
parent 84fb50df67
commit eee34ef64c
5 changed files with 26 additions and 1 deletions

View file

@ -731,10 +731,10 @@ class Queries1Tests(TestCase):
q.extra(select={'foo': "1"}),
[]
)
self.assertQuerysetEqual(q.reverse(), [])
q.query.low_mark = 1
with self.assertRaisesMessage(AssertionError, 'Cannot change a query once a slice has been taken'):
q.extra(select={'foo': "1"})
self.assertQuerysetEqual(q.reverse(), [])
self.assertQuerysetEqual(q.defer('meal'), [])
self.assertQuerysetEqual(q.only('meal'), [])