summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJulien Phalip <jphalip@gmail.com>2012-01-03 09:06:19 +0000
committerJulien Phalip <jphalip@gmail.com>2012-01-03 09:06:19 +0000
commitc93933441e77cefbcb354196bda9a29b7e75df18 (patch)
tree7e9c28aa73252058ad50d1a8f875aa965b72c9cc /tests
parent31b1cbc623c246570e7301c0334df938d840638f (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/queries/tests.py11
1 files changed, 11 insertions, 0 deletions
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: t1>', '<Tag: t2>', '<Tag: t3>', '<Tag: t4>', '<Tag: t5>'],
+ )
+ Tag._meta.ordering = original_ordering
class Queries2Tests(TestCase):
def setUp(self):