【发布时间】:2015-10-28 11:37:43
【问题描述】:
我在 Docker 容器中运行 Django 测试并使用 manage.py 运行我的测试。我的测试文件从django.test 导入TestCase,但由于某些原因,无法识别像AssertEqual 这样的命令:
AttributeError: 'TestSession' object has no attribute 'AssertEqual'
我做错了什么?
【问题讨论】:
我在 Docker 容器中运行 Django 测试并使用 manage.py 运行我的测试。我的测试文件从django.test 导入TestCase,但由于某些原因,无法识别像AssertEqual 这样的命令:
AttributeError: 'TestSession' object has no attribute 'AssertEqual'
我做错了什么?
【问题讨论】:
命令是assertEqual(注意断言中的小写'a'),而不是AssertEqual。
【讨论】: