postgresql - How can we make Django tests faster? -


we using django 1.4 postgresql on ubuntu 12.04. have many tests, , problem running tests slow, think because each test database created scratch. want make tests faster running them database in memory (not hard disk). how do it? have links or tutorials?

the best option have separate settings file tests. in settings_test.py tell use sqlite default use in-memory database:

from base_settings import *  databases = {   'default': {     'engine': 'django.db.backends.sqlite3',     'name': ':memory'   } } 

and run tests adding --settings=settings_test

see django docs:
https://docs.djangoproject.com/en/dev/topics/testing/overview/#the-test-database


Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -