#10716: Syntax error and bug in db/backends/oracle/creation.py
---------------------------------------------------+------------------------
          Reporter:  canarix                       |         Owner:  nobody
            Status:  reopened                      |     Milestone:  1.1   
         Component:  Database layer (models, ORM)  |       Version:  1.0   
        Resolution:                                |      Keywords:  oracle
             Stage:  Accepted                      |     Has_patch:  1     
        Needs_docs:  0                             |   Needs_tests:  0     
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Comment (by kmtracey):

 Added a patch that makes it possible to run tests on Oracle again.

 First, the patch reverts the parts of the original fix that recorded
 TEST_DATABASE_NAME in settings.DATABASE_NAME.  I really don't have much a
 clue when it comes to Oracle, but it appears that this change caused a
 problem because Oracle test database creation doesn't actually create a
 database, it creates a tablespace within the DATABASE_NAME.  If you then
 overwrite DATABASE_NAME with the test database (tablespace for Oracle)
 name in settings, when running the tests an attempt is made to connect to
 the test tablespace as a database, but it's not a database, so the connect
 attempt for running the tests fails.

 It's all a bit unclear to me but it appears things are set up so that by
 use of the test tablespace and a test user that uses that tablespace by
 default, all of the test table creation, etc. is isolated from the
 production DB.  canarix, do you experience the test data actually
 interfering with the production DB?  Or did the code just look wrong?

 The fix to the `ettings` instead of `settings` typo also causes a problem
 as given the way the code is written `test_` is being prepended to the
 database user name both when it is created and when it is destroyed.  So
 given a database user of `system`, the code will create user `test_system`
 then attempt to destroy `test_test_system` at the end.  Recording the test
 user name as settings.TEST_USER_NAME avoids that problem so I opted for
 that instead of reverting what seems to be a clear typo in the original
 code.  But someone with more of a clue on Oracle should probably take a
 look at this.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10716#comment:6>
Django <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 django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to