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

Тел: +7 965 3737 888

463

Просмотров

2

Ответов

Exclude Apps When Testing

This allows you to exclude certain apps when doing standard tests (manage.py test) by default. You set the settings/local_settings variable EXCLUDE_APPS and it will exclude those apps (like django, registration, south... etc). This makes running tests much faster and you don't have to wait for a bunch of tests you don't care about (per say).

You can override it by adding the app to the command line still. So if 'south' is in the excluded apps you can still run:

'python manage.py test south'

and it will run the south tests.

You will also need to tell django to use this as the test runner: TEST_RUNNER = 'testing.simple.AdvancedTestSuiteRunner'

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

Ответы (2):

Ответkingrolo:05.04.2011
Ответ полезен? Да0/Нет0

Just what I needed - thanks.

(One brief note, the settings for settings.py is TEST_EXCLUDE rather than EXCLUDE_APPS incase anyone else misses that).

Cheers.

Ответcronosa:29.09.2010
Ответ полезен? Да0/Нет0

So to install:

  1. Place this in an app (I put it in a testing app in a file named simple.py)

  2. Add TEST_RUNNER="testing.simple.AdvancedTestSuiteRunner" to settings

  3. Add EXCLUDE_APPS = ('django', 'app2', app3')