summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-04-22 12:02:07 +0000
committerJannis Leidel <jannis@leidel.info>2011-04-22 12:02:07 +0000
commita845eba8dded42a58d5b42bcb087b3f4bc65a26e (patch)
treed2806b86f7bb4cd566cc766963b610fd9d531a50 /tests
parent59d1f82634456851592857a41100c572637642ad (diff)
Fixed #11283 -- Made sure that latest() clears previously specified ordering in a QuerySet. Thanks to benmoran, punteney, mk and and Julien Phalip.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16067 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/get_latest/tests.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/modeltests/get_latest/tests.py b/tests/modeltests/get_latest/tests.py
index 3c3588bba0..97cd22bf91 100644
--- a/tests/modeltests/get_latest/tests.py
+++ b/tests/modeltests/get_latest/tests.py
@@ -43,6 +43,9 @@ class LatestTests(TestCase):
a3,
)
+ # Ensure that latest() overrides any other ordering specified on the query. Refs #11283.
+ self.assertEqual(Article.objects.order_by('id').latest(), a4)
+
def test_latest_manual(self):
# You can still use latest() with a model that doesn't have
# "get_latest_by" set -- just pass in the field name manually.