From c93933441e77cefbcb354196bda9a29b7e75df18 Mon Sep 17 00:00:00 2001 From: Julien Phalip Date: Tue, 3 Jan 2012 09:06:19 +0000 Subject: Fixed #17429 -- Ensured that `Meta.ordering=None` works the same if it were an empty list. Thanks to self[at]dicos[dot]ru for the report and to bigkevmcd for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17334 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/queries/tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/regressiontests') diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py index 8e9705e9f7..ded3e8ffa7 100644 --- a/tests/regressiontests/queries/tests.py +++ b/tests/regressiontests/queries/tests.py @@ -830,6 +830,17 @@ class Queries1Tests(BaseQuerysetTest): 1 ) + def test_ticket17429(self): + """ + Ensure that Meta.ordering=None works the same as Meta.ordering=[] + """ + original_ordering = Tag._meta.ordering + Tag._meta.ordering = None + self.assertQuerysetEqual( + Tag.objects.all(), + ['', '', '', '', ''], + ) + Tag._meta.ordering = original_ordering class Queries2Tests(TestCase): def setUp(self): -- cgit v1.3