How to improve TestCase speed in Django?

0

I'm running a test in Django with just two querys and in the timer it's taking 1 min and 10 seconds to finalize the test. Is there a setting I can adjust to speed up testing?

I'm currently using in the project database.

    
asked by anonymous 04.09.2015 / 22:38

1 answer

1

I was able to improve performance by changing the database to sqlite3 and directing the test to a specific app:

settings.py (at the end of the file):

import sys
if 'test' in sys.argv:
    DATABASES['default'] = {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'test_db'
    }

terminal:

$ ./manage.py test animals.tests

While running the test, the time dropped to 5 seconds .

    
04.09.2015 / 23:06