Esempio n. 1
0
def skipUnlessMutantModelDBFeature(feature, default=True):
    dbs = tuple(model_dbs(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))
Esempio n. 2
0
def skipIfMutantModelDBFeature(feature, default=False):
    dbs = tuple(model_dbs(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))
Esempio n. 3
0
def skipUnlessInternet():
    """
    Skip a test unless it seems like the machine running the test is
    connected to the internet.

    """
    return _deferredSkip(lambda: not _have_internet_connection(),
                         "Not connected to the internet.")
Esempio n. 4
0
def skipUnlessInternet():
    """
    Skip a test unless it seems like the machine running the test is
    connected to the internet.

    """
    return _deferredSkip(lambda: not _have_internet_connection(),
                         "Not connected to the internet.")
Esempio n. 5
0
def skipIfDBVendor(*vendors):
    return _deferredSkip(
        lambda: any(connection.vendor == vendor for vendor in vendors),
        "Database has vendor(s) %s" % ", ".join(vendors))