mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +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:
parent
093fd479d6
commit
ad4a8acdb5
7 changed files with 137 additions and 32 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue