Make aggregates fully support column aliases
This commit is contained in:
@@ -17,6 +17,10 @@ def count_sql_calls(conn, cursor, statement, parameters, context, executemany):
|
|||||||
conn.query_count += 1
|
conn.query_count += 1
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
conn.query_count = 0
|
conn.query_count = 0
|
||||||
|
try:
|
||||||
|
conn.queries.append(statement)
|
||||||
|
except AttributeError:
|
||||||
|
conn.queries = [statement]
|
||||||
|
|
||||||
|
|
||||||
warnings.simplefilter('error', sa.exc.SAWarning)
|
warnings.simplefilter('error', sa.exc.SAWarning)
|
||||||
@@ -55,6 +59,7 @@ class TestCase(object):
|
|||||||
def teardown_method(self, method):
|
def teardown_method(self, method):
|
||||||
aggregates.manager.reset()
|
aggregates.manager.reset()
|
||||||
self.session.close_all()
|
self.session.close_all()
|
||||||
|
self.connection.queries = []
|
||||||
if self.create_tables:
|
if self.create_tables:
|
||||||
self.Base.metadata.drop_all(self.connection)
|
self.Base.metadata.drop_all(self.connection)
|
||||||
self.connection.close()
|
self.connection.close()
|
||||||
|
@@ -76,5 +76,6 @@ class TestAggregateManyToManyAndManyToMany(TestCase):
|
|||||||
catalog2 = self.Catalog(products=products)
|
catalog2 = self.Catalog(products=products)
|
||||||
self.session.add(catalog)
|
self.session.add(catalog)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
|
print self.connection.queries[-1]
|
||||||
assert catalog.category_count == 1
|
assert catalog.category_count == 1
|
||||||
assert catalog2.category_count == 1
|
assert catalog2.category_count == 1
|
||||||
|
Reference in New Issue
Block a user