summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-15 09:13:22 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-15 09:13:22 +0000
commit93baa3e4170ea40be967d48560ffca55395be07b (patch)
treed364eb6f82b50e36aa354d1af4da14bd9cdb7ab7 /tests/regressiontests
parent7534ef1f7e86a301a2dd788855095262d2925832 (diff)
queryset-refactor: Optimised some internal data structures in sql/query.py.
Mostly this involves changing them to a "copy on write" implementation, which speeds up cloning (and the relevant structures aren't updated very frequently). git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7247 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/queries/models.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py
index 7185558f45..a9783569a7 100644
--- a/tests/regressiontests/queries/models.py
+++ b/tests/regressiontests/queries/models.py
@@ -205,7 +205,7 @@ Bug #1801
Bug #2306
Checking that no join types are "left outer" joins.
>>> query = Item.objects.filter(tags=t2).query
->>> query.LOUTER not in [x[2][2] for x in query.alias_map.values()]
+>>> query.LOUTER not in [x[2] for x in query.alias_map.values()]
True
>>> Item.objects.filter(Q(tags=t1)).order_by('name')
@@ -332,12 +332,12 @@ Bug #5324, #6704
# Excluding from a relation that cannot be NULL should not use outer joins.
>>> query = Item.objects.exclude(creator__in=[a1, a2]).query
->>> query.LOUTER not in [x[2][2] for x in query.alias_map.values()]
+>>> query.LOUTER not in [x[2] for x in query.alias_map.values()]
True
Similarly, when one of the joins cannot possibly, ever, involve NULL values (Author -> ExtraInfo, in the following), it should never be promoted to a left outer join. So hte following query should only involve one "left outer" join (Author -> Item is 0-to-many).
>>> qs = Author.objects.filter(id=a1.id).filter(Q(extra__note=n1)|Q(item__note=n3))
->>> len([x[2][2] for x in qs.query.alias_map.values() if x[2][2] == query.LOUTER])
+>>> len([x[2] for x in qs.query.alias_map.values() if x[2] == query.LOUTER])
1
The previous changes shouldn't affect nullable foreign key joins.