Django

Code

Show
Ignore:
Timestamp:
10/24/08 01:24:04 (3 months ago)
Author:
mtredinnick
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/regressiontests/queries/models.py

    r9221 r9254  
    975975True 
    976976 
    977 Make sure bump_prefix() (an internal Query method) doesn't (re-)break. 
    978 >>> query = Tag.objects.values_list('id').order_by().query 
    979 >>> query.bump_prefix() 
    980 >>> print query.as_sql()[0] 
    981 SELECT U0."id" FROM "queries_tag" U0 
     977Make sure bump_prefix() (an internal Query method) doesn't (re-)break. It's 
     978sufficient that this query runs without error. 
     979>>> qs = Tag.objects.values_list('id', flat=True).order_by('id') 
     980>>> qs.query.bump_prefix() 
     981>>> list(qs) 
     982[1, 2, 3, 4, 5] 
    982983 
    983984Calling order_by() with no parameters removes any existing ordering on the