跳转到主要内容

未知

项目描述

测试辅助工具,主要针对数据库。在Django 1.2上测试过。

安装

pip install django-test-helpers

使用方法

创建一个临时数据库

from testhelpers.dbmanager import TemporaryDatabase

with TemporaryDatabase(fixtures=['myfixture.json'], db_prefix='test'):
    # do some stuff
    pass

在事务隔离中运行一些命令

from testhelpers.dbmanager import Transactionless

with Transactionless(fixtures=['myfixture.json']):
    # do some stuff
    pass

由以下组织支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面