0

In My Project more than one test file and if i run

python manage.py tests

It takes huge time to complete the test and i don't want this way.

I want only run particular file of test like i have test

project/todo/tests/test_todo.py
project/accounts/tests/test_signup.py
project/todo/tests/test_archive.py

and lots more like above these:

Now i want to run only project/todo/tests/test_todo.py How can i do it?

2 Answers 2

2

you can simply do python manage.py test project.todo.tests.test_todo. Observe the difference here instead of giving it as a file, you can give it as a package. If you want to run a particular test case in a test suite, you can go ahead in the same way. python manage.py test project.todo.tests.test_todo.TestSuiteClass.TestCase.

Sign up to request clarification or add additional context in comments.

1 Comment

@mamuncode if this solves the problem, please consider upvoting and accepting the answer.
0

You can run a particular test by using the following command.

python manage.py test -nk appname.test_folder.test_file

-n, --nomigrations    Tells Django to NOT use migrations and create all
                        tables directly.
-k, --keepdb          Preserves the test DB between runs.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.