mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
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
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user