Why isn't django-nose running the doctests in my models?

穿精又带淫゛_ 提交于 2019-12-02 09:27:05

问题


I'm trying to use doctests with django-nose. All my doctests are running, except not any doctests within a model (unless it is abstract).

class TestModel1(models.Model):
    """
    >>> print 'pass'
    pass
    """
    pass

class TestModel2(models.Model):
    """
    >>> print 'pass'
    pass
    """
    class Meta:
        abstract = True
    pass

The first doctest does not run and the second does. Why is this?


回答1:


Any chance you're getting bitten by this? http://github.com/jbalogh/django-nose/issues/2 If so, try upgrading django-nose



来源:https://stackoverflow.com/questions/2614363/why-isnt-django-nose-running-the-doctests-in-my-models

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!