开发者

Django - Testing with parts of original database

My database has two types of entries: The ver开发者_JS百科y dynamic (users, comments, etc) and the more static (email templates, flat-pages).

During testing I want a clean DB but with the real 'semi-static' data.

Is there a way to make Django's testing system to load parts of the original DB ?

Thanks


Use fixtures. See the documentation or the (wiki page](https://code.djangoproject.com/wiki/Fixtures)

Put data you need into fixtures and they will be loaded every time test database is built.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜