在几个文件中分割django应用程序测试 [英] split django app tests in several files

查看:233
本文介绍了在几个文件中分割django应用程序测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个django 1.2应用程序,我是一个初学者的框架,我想分开我的测试在几个文件的应用程序 https://github.com/vkhemlan/BolsaTrabajo/tree/master/bolsa_trabajo ,我该怎么办?我要做什么配置?



问候语

解决方案

测试django应用程序的真正好的指南:
Django中的测试指南



而且 github上的示例应用程序拆分表单视图 >模型分成单独的文件,所以这可能是一个很好的例子。



注意每个测试模块在 __ init __。py 中的导入:



pre> from polls.tests.forms import *
from polls.tests.models import *
from polls.tests.views import *


I'm working on a django 1.2 app and I'm a kind of beginner with the framework, I want to split my tests in several files for the app https://github.com/vkhemlan/BolsaTrabajo/tree/master/bolsa_trabajo, how I can do that? what configurations I have to do?

greetings

解决方案

Here's a really good guide on testing django apps: A Guide to Testing in Django

And the example app on github splits the tests for forms, views and models into separate files, so it is probably a good example for you.

Note how each test module gets imported in __init__.py:

from polls.tests.forms import *
from polls.tests.models import *
from polls.tests.views import *

这篇关于在几个文件中分割django应用程序测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆