Is it possible to run a single doc in Django using the command "manage.py test"

In my Django application, I have a combination of doctrines (defined in models.py and views.py) and unit tests (defined in test.py. I can call a separate unit test by doing:

manage.py test app.TestCase

However, this does not seem to work for doctrines. Is there a way to run one doctrine (defined in models.py or views.py)?

+3
source share
3 answers

I have posted a small script that allows you to run doctrines in a specific file or module in your project. Launching doctrines from a specific file or module: LINK .

( , manage.py). , .

+1

, python - .

, manage.py python.

+3

Try it like this:

python -m doctest views.py
0
source

Source: https://habr.com/ru/post/1721621/


All Articles