跳转到主要内容

未知

项目描述

测试辅助工具,主要针对数据库。在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

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

django-test-helpers-0.1.0.tar.gz (5.0 kB 查看散列)

上传时间:

由以下组织支持

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