Re: Running unit tests when you can't create a new database

2009-12-09 Thread Martin Omander
Sean, That's great stuff; exactly what I was looking for. Thanks for the pointer! /Martin On Dec 9, 12:40 pm, Sean Brant wrote: > This might help you > outhttp://ericholscher.com/projects/django-test-utils/keep_database_runn > Or at least give you some pointers. > > - Sean > > On Wed, Dec

Re: Running unit tests when you can't create a new database

2009-12-09 Thread Sean Brant
This might help you out http://ericholscher.com/projects/django-test-utils/keep_database_runner.html. Or at least give you some pointers. - Sean On Wed, Dec 9, 2009 at 2:16 PM, Martin Omander wrote: > Russ, > > The method you describe sounds like the preferred way. It's cleaner to > add a new te

Re: Running unit tests when you can't create a new database

2009-12-09 Thread Martin Omander
Russ, The method you describe sounds like the preferred way. It's cleaner to add a new test runner module than to modify existing Django code. I really like it. But as you say, it's not obvious how to do this. I'd like to do a write-up of how this is done, for the common use case where you don't

Re: Running unit tests when you can't create a new database

2009-12-09 Thread Russell Keith-Magee
On Wed, Dec 9, 2009 at 7:22 PM, wrote: >> Django allows you to define a custom test runner. Copy >> django.tests.simple.run_tests() into your own code, removing the calls >> to create and destroy the test database. Then set TEST_RUNNER in your >> settings file to point at the new runner. > Hello!

Re: Running unit tests when you can't create a new database

2009-12-09 Thread Russell Keith-Magee
On Wed, Dec 9, 2009 at 7:22 PM, wrote: >> Django allows you to define a custom test runner. Copy >> django.tests.simple.run_tests() into your own code, removing the calls >> to create and destroy the test database. Then set TEST_RUNNER in your >> settings file to point at the new runner. > Hello!

Re: Running unit tests when you can't create a new database

2009-12-09 Thread reg_gc
> Django allows you to define a custom test runner. Copy > django.tests.simple.run_tests() into your own code, removing the calls > to create and destroy the test database. Then set TEST_RUNNER in your > settings file to point at the new runner. Hello! I see many similar bugreports and wishes which

Re: Running unit tests when you can't create a new database

2009-12-09 Thread Russell Keith-Magee
On Wed, Dec 9, 2009 at 8:53 AM, Martin Omander wrote: > Hi all, > > How about letting Django users run unit tests without creating a new > test database? > > To use Django's built-in unit test harness, you have to have database > creation privileges. Not all web hosts give users those privileges.

Re: Running unit tests when you can't create a new database

2009-12-08 Thread Martin Omander
Good point about SQLite. I considered SQLite, but went with hacking the test code in the end. My production environment uses MySql, so my test environment should as well. For example, I just uncovered a bug in my code that has to do with database interactions. This bug may or may not show up when

Re: Running unit tests when you can't create a new database

2009-12-08 Thread rebus_
2009/12/9 Martin Omander : > Hi all, > > How about letting Django users run unit tests without creating a new > test database? > > To use Django's built-in unit test harness, you have to have database > creation privileges. Not all web hosts give users those privileges. > For example, Webfaction, a

Running unit tests when you can't create a new database

2009-12-08 Thread Martin Omander
Hi all, How about letting Django users run unit tests without creating a new test database? To use Django's built-in unit test harness, you have to have database creation privileges. Not all web hosts give users those privileges. For example, Webfaction, an excellent commercial Django host by all