def skipUnlessMutantModelDBFeature(feature, default=True): dbs = tuple(allow_migrate(MutableModel)) def _dbs_dont_have_feature(): return all(not getattr(connections[db].features, feature, default) for db in dbs) return _deferredSkip(_dbs_dont_have_feature, "Databases %s don't have feature %s" % (dbs, feature))
def skipIfMutantModelDBFeature(feature, default=False): dbs = tuple(allow_migrate(MutableModel)) def _dbs_have_feature(): return all(getattr(connections[db].features, feature, default) for db in dbs) return _deferredSkip(_dbs_have_feature, "Databases %s have feature %s" % (dbs, feature))
def assertModelTablesColumnDoesntExists(self, model, column): table = model._meta.db_table for db in allow_migrate(model): self.assertColumnDoesntExists(db, table, column)
def assertModelTablesDontExist(self, model): table = model._meta.db_table for db in allow_migrate(model): self.assertTableDoesntExists(db, table)