我第一次使用django单元测试。以下是我的代码的缩小版本。 我的假设是每个TestCase类都会调用一次setUp函数。但是当我运行python manage.py test命令时,每个测试函数都会调用一次setUp函数。 我做错了什么或者我的假设有什么不对吗? class SampleTest(TestCase):
"""
This class assumes an ar
我试图测试我的注册网址。当我做到以下时,它给了我一个错误。 tests.py from __future__ import unicode_literals
from django.test import TestCase
# Create your tests here.
class SignUpTest(TestCase):
def test_createAccount(sel
过去几周我一直在学习django,我尝试使用参数化fixture和测试函数,从我的理解我可以简单地一次运行多个测试。通过参数化测试,我试图测试所有模型中的函数。我阅读了文档,但不幸的是,只要我尝试过,我收到以下错误消息Database access not allowed, use the "django_db" mark, or the "db" or "transactional_db" fi