在使用pythonbook进行测试驱动开发之后,我陷入了困境 我试过几种不同的进口货,但还是没有。。有人吗?在
错误
$python manage.py test functional_tests
ERROR: test_can_start_a_list_and_retrieve_it_later (functional_tests.tests.NewVisitorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/coelhao/DjangoProjects/superlists/functional_tests/tests.py", line 45, in
test_can_start_a_list_and_retrieve_it_later
self.assertRegex(edith_list_url, '/lists/.+') AttributeError: 'NewVisitorTest' object has no attribute 'assertRegex'
代码
^{pr2}$
没有
assertRegex
这样的断言——也许你是说assertRegexMatches
?在unittest文档在这里:http://docs.python.org/2.7/library/unittest.html#unittest.TestCase
我假设您使用Python2—然后使用^{} 而不是{}。在
在Python 3中引入了^{} :
相关问题 更多 >
编程相关推荐