I'm checking out the changes from the last three weeks in svn ...
seems like the test suite is a little bit different now ;-)
I can't say much about it now other than I appreciate all the
hard work by Russell, and that there's a nice test framework in
place now.
Only ... I find the naming of the test database a bit
inconvenient. It's created as 'test_' + settings.DATABASE_NAME
(unless you use sqlite).
My problems with this is that it does not allow me to choose a
name on my own. Now I cannot use the old 'django_test_db', since
it doesn't start with 'test_'. And using the default
'test_myprojectdatabase' is not an option at all since that is
used for a different purpose. So I need to contact my admins to
get a new database, set up a settings file dedicated for running
the django test suite, just to do that.
I can work around this, sure, but I'd propose to allow to
overwrite the default test database name for the test suite
somehow, preferably on the command line of runtests.py.
This probably also applies to using the test framework for your
own application (as opposed to django's own test suite), but I
haven't digged into this, yet.
Cheers,
Michael
I can work around this, sure, but I'd propose to allow to
overwrite the default test database name for the test suite
somehow, preferably on the command line of runtests.py.
Hey Russ,
Any particular reason you used a setting instead of a simple
command-line parameter? In my view, we should only be adding settings
if absolutely necessary.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
Any particular reason you used a setting instead of a simple
command-line parameter? In my view, we should only be adding settings
if absolutely necessary.
OK, cool -- sounds reasonable. I just wanted to make sure it was
essential / thought-through.
-- Ned Batchelder, http://nedbatchelder.com
Partly on this topic: I would very much like to use sqlite in-memory databases for testing, even though I use MySQL for deployment. The speed difference is 10x. One way to do this is to have a TEST_DATABASE_ENGINE setting, and add logic to create_test_db().
Thoughts?
I don't see the need for Django specific TEST_* settings when it is
simple enough to do this in myapp/testsettings.py:
from myapp.settings import *
DATABASE_ENGINE='sqlite3'
DATABASE_NAME=':memory:'
and use ./manage.py --settings=myapp.testsettings.
matthew
Just my 2c:
In the beginning, I tried to use SQLite for my tests. I soon
found that this would not work without major changes because of
the various nasty differences between the SQL engines. Also, I
need to be sure that everything works under MySQL, so I now even
run the django test suite under MySQL.
All in all, I don't find this option useful for me, though
other's mileage may vary.
Michael
and use ./manage.py --settings=myapp.testsettings.