【问题标题】:How to split Django app tests across several files如何将 Django 应用程序测试拆分到多个文件中
【发布时间】:2011-09-04 00:30:59
【问题描述】:

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

【问题讨论】:

标签: django unit-testing file split


【解决方案1】:

这是一个非常好的测试 django 应用程序的指南: A Guide to Testing in Django

example app on githubformsviewsmodels 的测试拆分为单独的文件,因此它可能是一个很好的示例你。

注意每个测试模块是如何导入__init__.py的:

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

【讨论】:

猜你喜欢
  • 2012-02-03
  • 1970-01-01
  • 2015-07-24
  • 2021-12-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-03-02
  • 2015-01-13
相关资源
最近更新 更多