def assert_sql(self, db, callable_, rules):
    newrules = []
    for rule in rules:
        if isinstance(rule, dict):
            newrule = assertsql.AllOf(*[assertsql.CompiledSQL(k, v) for (k, v) in rule.items()])
        else:
            newrule = assertsql.CompiledSQL(*rule)
        newrules.append(newrule)
    return self.assert_sql_execution(db, callable_, *newrules)
def assert_sql(self, db, callable_, rules):
    newrules = []
    for rule in rules:
        if isinstance(rule, dict):
            newrule = assertsql.AllOf(*[assertsql.CompiledSQL(k, v) for (k, v) in rule.items()])
        else:
            newrule = assertsql.CompiledSQL(*rule)
        newrules.append(newrule)
    return self.assert_sql_execution(db, callable_, *newrules)