def do_count(self, value): return query.count(self.connection, value)
def _test(self, result, *parts, **kwargs): q = query.Query(DummyView, *parts, sorting=kwargs.pop('sorting', None)) count = yield query.count(self.connection, q) self.assertEquals(len(result), count) res = yield query.select(self.connection, q) self.assertEquals(result, res)
def _query_test(self, result, *parts, **kwargs): q = query.Query(QueryView, *parts, sorting=kwargs.pop('sorting', None)) res = yield query.select(self.connection, q) self.assertEquals(result, [x.field1 for x in res]) count = yield query.count(self.connection, q) self.assertEquals(len(result), count)