#5453: Test database used in runtests.py does not match documented behavior
-----------------------+----------------------------------------------------
Reporter:  mcroydon    |       Owner:  nobody          
  Status:  new         |   Component:  Unit test system
 Version:  SVN         |    Keywords:                  
   Stage:  Unreviewed  |   Has_patch:  0               
-----------------------+----------------------------------------------------
 As of [6184], it is impossible to set {{{TEST_DATABASE_NAME}}} and have
 that be used when tests/runtests.py is run.  The test runner overrides
 {{{settings.TEST_DATABASE_NAME}}} with the hard-coded value
 {{{'django_test_db'}}}, so that even if {{{TEST_DATABASE_NAME}}} is set,
 it will be ignored:
 {{{
 mattbookpro:~/code/python/sprint/django-trunk mcroydon$ python
 tests/runtests.py --settings=sprint.settings
 Got an error creating the test database: database "django_test_db" already
 exists
 }}}
 
 After applying the patch, what actually happens matches
 [http://www.djangoproject.com/documentation/testing/#understanding-the-
 test-output the test documentation].  If your {{{DATABASE_NAME}}} is
 {{{"mydatabase"}}} and {{{TEST_DATABASE_NAME}}} is not set, the test
 framework will use  {{{"test_mydatabase"}}}:
 {{{
 mattbookpro:~/code/python/sprint/django-trunk mcroydon$ python
 tests/runtests.py --settings=sprint.settings
 Got an error creating the test database: database "test_mydatabase"
 already exists
 }}}
 
 If you set {{{TEST_DATABASE_NAME}}} to {{{"arbitrarytestdb"}}} that
 database will be used for testing instead:
 {{{
 mattbookpro:~/code/python/sprint/django-trunk mcroydon$ python
 tests/runtests.py --settings=sprint.settings
 Got an error creating the test database: database "arbitrarytestdb"
 already exists
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5453>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to