summaryrefslogtreecommitdiff
path: root/tests/aggregation
diff options
context:
space:
mode:
authorJosh Smeaton <josh.smeaton@gmail.com>2014-11-16 12:56:42 +1100
committerSimon Charette <charette.s@gmail.com>2014-11-16 13:19:34 +0100
commitf61256da3a266c75c2f75c35172832bf2d605939 (patch)
tree7042d1d9def507c245b03f074681e5f4ff898415 /tests/aggregation
parent05e0e4674ce9995a1dc5962001747abce30e4f69 (diff)
Renamed qn to compiler
Diffstat (limited to 'tests/aggregation')
-rw-r--r--tests/aggregation/tests.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py
index 8c6529c73b..e4b821b43d 100644
--- a/tests/aggregation/tests.py
+++ b/tests/aggregation/tests.py
@@ -863,8 +863,8 @@ class ComplexAggregateTestCase(TestCase):
def test_add_implementation(self):
try:
# test completely changing how the output is rendered
- def lower_case_function_override(self, qn, connection):
- sql, params = qn.compile(self.source_expressions[0])
+ def lower_case_function_override(self, compiler, connection):
+ sql, params = compiler.compile(self.source_expressions[0])
substitutions = dict(function=self.function.lower(), expressions=sql)
substitutions.update(self.extra)
return self.template % substitutions, params
@@ -877,9 +877,9 @@ class ComplexAggregateTestCase(TestCase):
self.assertEqual(b1.sums, 383)
# test changing the dict and delegating
- def lower_case_function_super(self, qn, connection):
+ def lower_case_function_super(self, compiler, connection):
self.extra['function'] = self.function.lower()
- return super(Sum, self).as_sql(qn, connection)
+ return super(Sum, self).as_sql(compiler, connection)
setattr(Sum, 'as_' + connection.vendor, lower_case_function_super)
qs = Book.objects.annotate(sums=Sum(F('rating') + F('pages') + F('price'),
@@ -889,7 +889,7 @@ class ComplexAggregateTestCase(TestCase):
self.assertEqual(b1.sums, 383)
# test overriding all parts of the template
- def be_evil(self, qn, connection):
+ def be_evil(self, compiler, connection):
substitutions = dict(function='MAX', expressions='2')
substitutions.update(self.extra)
return self.template % substitutions, ()
@@ -921,8 +921,8 @@ class ComplexAggregateTestCase(TestCase):
class Greatest(Func):
function = 'GREATEST'
- def as_sqlite(self, qn, connection):
- return super(Greatest, self).as_sql(qn, connection, function='MAX')
+ def as_sqlite(self, compiler, connection):
+ return super(Greatest, self).as_sql(compiler, connection, function='MAX')
qs = Publisher.objects.annotate(
price_or_median=Greatest(Avg('book__rating'), Avg('book__price'))