Python django.test 模块-SimpleTestCase() 实例源码

Python django.test 模块,SimpleTestCase() 实例源码

我们从Python开源项目中,提取了以下1代码示例,用于说明如何使用django.test.SimpleTestCase()

项目:munch-core    作者:crunchmail    | 项目源码 | 文件源码
def __call__(self, test_func):
        from django.test import SimpleTestCase
        if isinstance(test_func, type):
            if not issubclass(test_func, SimpleTestCase):
                raise Exception(
                    "Only subclasses of Django SimpleTestCase "
                    "can be decorated with temporary_settings")
            return test_func
        else:
            @wraps(test_func)
            def inner(*args, **kwargs):
                with self:
                    return test_func(*args, **kwargs)
        return inner

相关文章

Python setuptools.dep_util 模块,newer_pairwise_group() ...
Python chainer.utils.type_check 模块,eval() 实例源码 我...
Python chainer.utils.type_check 模块,prod() 实例源码 我...
Python chainer.utils.type_check 模块,expect() 实例源码 ...
Python multiprocessing.managers 模块,BaseProxy() 实例源...
Python multiprocessing.managers 模块,RemoteError() 实例...