1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #11557 -- Added support for a list of fields in Meta.get_latest_by and QuerySet.earliest()/latest().

This commit is contained in:
François Freitag
2017-06-21 13:28:16 -07:00
committed by Tim Graham
parent 093fd479d6
commit ad4a8acdb5
7 changed files with 137 additions and 32 deletions

View File

@@ -2365,7 +2365,7 @@ class WeirdQuerysetSlicingTests(TestCase):
self.assertQuerysetEqual(Article.objects.all()[0:0], [])
self.assertQuerysetEqual(Article.objects.all()[0:0][:10], [])
self.assertEqual(Article.objects.all()[:0].count(), 0)
with self.assertRaisesMessage(AssertionError, 'Cannot change a query once a slice has been taken.'):
with self.assertRaisesMessage(TypeError, 'Cannot reverse a query once a slice has been taken.'):
Article.objects.all()[:0].latest('created')
def test_empty_resultset_sql(self):