0

I started a deadly simple django project to try django's doctest:

# models.py
"""
>>> 1+1 == 2
True
"""

and run python manage.py test get:

Creating test database for alias 'default'...

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
Destroying test database for alias 'default'...

Same as running python manage.py play.

I fixed this by setting:

INSTALLED_APPS = (
...
'django_nose',
)
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = ['--with-doctest']

My question is that whether my setting is needed or not? Cause it's not mentioned in the doc: https://docs.djangoproject.com/en/1.4/topics/testing/

My django version is 1.7, is it the difference between 1.4 and 1.7?

Kane Blueriver
  • 4,170
  • 4
  • 29
  • 48

1 Answers1

1

Since 1.6, doctests are no longer automatically discovered by Django. You'll find more on how to integrate doctests in the 1.6 release documentation.

Mathieu Dhondt
  • 8,405
  • 5
  • 37
  • 58