Задать вопрос

Тел: +7 965 3737 888

419

Просмотров

0

Ответов

Fail Faster: unsafe_test Management Command

The faster you fail the faster you reach success. This management command runs tests within the django environment, but without a test database, hence the word "UNSAFE". It only runs unittests for a single application, which are not subclasses of django.test.TestCase. Django's TestCases are not supported because they attempt to purge the database. Turn this flaw into a feature by segregating testcases into those that either need or don't need the test database. This tool may not be useful in all cases, but in certain cases you can have more rapid testing iterations. I use it for certain utility applications.

Setup:

Place in <app_name>/management/commands/unsafe_test.py

Run:

$./manage.py unsafe_test <app_name>

Вопрос полезен? Да0/Нет0
file_2336.py(1.9Кб)
None