def __max_queries(*args, **kwargs): q0 = len(connection.queries) ret = func(*args, **kwargs) q1 = len(connection.queries) if trace: print col("%s: %d queries" % (func.__name__, q1 - q0)) if q1 - q0 > n: raise AssertionError("%d queries in %s" % ( q1 - q0, func.__name__, )) return ret
def _print_queries(*args, **kwargs): q0 = len(connection.queries) ret = func(*args, **kwargs) q1 = len(connection.queries) print col("%s: %d queries" % (func.__name__, q1 - q0)) return ret