¿Db diferente para probar en Django?
DATABASES = {
# 'default': {
# 'ENGINE': 'postgresql_psycopg2',
# ...
# }
# for unit tests
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
}
Tengo dos bases de datos: una que me gustaría usar para pruebas unitarias y otra para todo lo demás. ¿Es posible configurar esto en Django 1.2.4?
(La razón por la que pregunto es porque con postgresql obtengo el siguiente error:
foo@bar:~/path/$ python manage.py test
Creating test database 'default'...
Got an error creating the test database: permission denied to create database
Type 'yes' if you would like to try deleting the test database 'test_baz', or 'no' to cancel: yes
Destroying old test database...
Got an error recreating the test database: database "test_baz" does not exist
¿Por qué podría estar recibiendo este error? Supongo que realmente no me importa si siempre puedo usar SQLite para pruebas unitarias, ya que funciona bien).