From 9180112f021d0a2a16e29565ece4f137a1a99823 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 19 Aug 2005 21:35:02 +0000 Subject: [PATCH] Added 'limit' and 'offset' unit tests, one of which fails in MySQL 3 (refs #350) git-svn-id: http://code.djangoproject.com/svn/django/trunk@540 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/testapp/models/ordering.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/testapp/models/ordering.py b/tests/testapp/models/ordering.py index 6f535f174f..0efa0638df 100644 --- a/tests/testapp/models/ordering.py +++ b/tests/testapp/models/ordering.py @@ -48,4 +48,12 @@ API_TESTS = """ [Article 1, Article 2, Article 3, Article 4] >>> articles.get_list(order_by=['pub_date', '-headline']) [Article 1, Article 3, Article 2, Article 4] + +# Use the "limit" parameter to limit the results. +>>> articles.get_list(order_by=['headline'], limit=2) +[Article 1, Article 2] + +# Use the "offset" parameter with "limit" to offset the result list. +>>> articles.get_list(order_by=['headline'], offset=1, limit=2) +[Article 2, Article 3] """