I'm using django 1.3 and writing some selenium test & django unit tests. I want to know if its possible to run the tests without creating the databases & loading fixtures everytime?
I stumbled upon this SO thread which gives a good way to test without creating a database but that still flushes the database fixtures & reloads them every time. I do not want even that to happen. I just want the tests to read / write the database I have set up once. I do not want it to create database / load fixtures every time I run any test.
I'd be glad to provide any further info if required to sort this out.
Thanks in advance! :)
I was able to do this by hacking into some django code. The parts that need to be edited is,
FILE: django/db/backends/sqlite3/creation.py
change the code as follows:
confirm = 'yes'
in line 55os.remove(test_database_name)
FILE: django/db/backends/creation.py
change the code as follows
create_test_db
function._create_test_db
. (almost everything == code part which does the undesired stuff which we are trying to eliminate)_destroy_test_db
.destroy_test_db
.Hope that helps!