#27435: Raise an error when using --keepdb without an explicit TEST.PASSWORD on
Oracle
-----------------------------------+------------------------------------
     Reporter:  Simon Charette     |                    Owner:  nobody
         Type:  Bug                |                   Status:  new
    Component:  Testing framework  |                  Version:  1.10
     Severity:  Release blocker    |               Resolution:
     Keywords:  oracle             |             Triage Stage:  Accepted
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------
Changes (by felixxm):

 * stage:  Unreviewed => Accepted


Comment:

 I think that the best solution will be to set up password randomly every
 time where it's not set and we use `--keepdb` flag:

 {{{#!python
 --- a/django/db/backends/oracle/creation.py
 +++ b/django/db/backends/oracle/creation.py
 @@ -225,7 +225,7 @@ class DatabaseCreation(BaseDatabaseCreation):
          acceptable_ora_err = 'ORA-01920' if keepdb else None
          success = self._execute_allow_fail_statements(cursor, statements,
 parameters, verbosity, acceptable_ora_err)
          # If the password was randomly generated, change the user
 accordingly.
 -        if not success and self._test_settings_get('PASSWORD') is None:
 +        if (not success or keepdb) and
 self._test_settings_get('PASSWORD') is None:
              set_password = "ALTER USER %(user)s IDENTIFIED BY
 %(password)s"
              self._execute_statements(cursor, [set_password], parameters,
 verbosity)
          # Most test-suites can be run without the create-view privilege.
 But some need it.
 }}}

 I can prepare PR.

--
Ticket URL: <https://code.djangoproject.com/ticket/27435#comment:1>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.c1988fa0b26dfe27112d9caa71dba137%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to