0
我開始了一個致命的簡單的Django項目嘗試Django的文檔測試:django是否需要先設置TEST_RUNNER才能運行doctest?
# models.py
"""
>>> 1+1 == 2
True
"""
和運行python manage.py test
得到:
Creating test database for alias 'default'...
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK
Destroying test database for alias 'default'...
與運行python manage.py play
。
INSTALLED_APPS = (
...
'django_nose',
)
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = ['--with-doctest']
我的問題是,是否需要我的設置與否:
我通過設置固定的呢?導致它沒有在文檔中提到:https://docs.djangoproject.com/en/1.4/topics/testing/
我的django版本是1.7,它是1.4和1.7之間的差異嗎?
關於django如何獲取doctests之前,你可以有更詳細的解釋嗎? – kxxoling
你可以在[Django 1.5 doctest文檔](https://docs.djangoproject.com/en/1.5/topics/testing/doctests/)中找到。 – LaundroMat