1
0
mirror of https://github.com/django/django.git synced 2024-12-23 17:46:27 +00:00

Fixed #9411 -- Changed the test from r9081 to be more robust across different database backends.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9254 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-10-24 06:24:04 +00:00
parent 9319dc496c
commit 3b5d975ff6

View File

@ -974,11 +974,12 @@ about them and shouldn't do bad things.
>>> expected == result
True
Make sure bump_prefix() (an internal Query method) doesn't (re-)break.
>>> query = Tag.objects.values_list('id').order_by().query
>>> query.bump_prefix()
>>> print query.as_sql()[0]
SELECT U0."id" FROM "queries_tag" U0
Make sure bump_prefix() (an internal Query method) doesn't (re-)break. It's
sufficient that this query runs without error.
>>> qs = Tag.objects.values_list('id', flat=True).order_by('id')
>>> qs.query.bump_prefix()
>>> list(qs)
[1, 2, 3, 4, 5]
Calling order_by() with no parameters removes any existing ordering on the
model. But it should still be possible to add new ordering after that.