Ticket #17786: 17786-second-try.patch

File 17786-second-try.patch, 2.2 KB (added by Aymeric Augustin, 13 years ago)
  • django/db/backends/oracle/creation.py

     
    4040        'URLField':                     'VARCHAR2(%(max_length)s)',
    4141    }
    4242
    43     # This dictionary stores the original values of user and passwd, which are
    44     # changed during the tests. It's stored at the class level because the
    45     # test database is created and destroyed by different connections (#17786).
    46     remember = {}
    47 
    4843    def __init__(self, connection):
    4944        super(DatabaseCreation, self).__init__(connection)
    5045
     
    6358            'tblspace_temp': TEST_TBLSPACE_TMP,
    6459        }
    6560
    66         self.remember['user'] = self.connection.settings_dict['USER']
    67         self.remember['passwd'] = self.connection.settings_dict['PASSWORD']
    68 
    6961        cursor = self.connection.cursor()
    7062        if self._test_database_create():
    7163            try:
     
    111103                    print "Tests cancelled."
    112104                    sys.exit(1)
    113105
    114         self.connection.settings_dict['TEST_USER'] = self.connection.settings_dict["USER"] = TEST_USER
    115         self.connection.settings_dict["PASSWORD"] = TEST_PASSWD
     106        self.connection.settings_dict['SAVED_USER'] = self.connection.settings_dict['USER']
     107        self.connection.settings_dict['SAVED_PASSWORD'] = self.connection.settings_dict['PASSWORD']
     108        self.connection.settings_dict['TEST_USER'] = self.connection.settings_dict['USER'] = TEST_USER
     109        self.connection.settings_dict['PASSWORD'] = TEST_PASSWD
    116110
    117111        return self.connection.settings_dict['NAME']
    118112
     
    127121        TEST_TBLSPACE = self._test_database_tblspace()
    128122        TEST_TBLSPACE_TMP = self._test_database_tblspace_tmp()
    129123
    130         self.connection.settings_dict["USER"] = self.remember['user']
    131         self.connection.settings_dict["PASSWORD"] = self.remember['passwd']
     124        self.connection.settings_dict['USER'] = self.connection.settings_dict['SAVED_USER']
     125        self.connection.settings_dict['PASSWORD'] = self.connection.settings_dict['SAVED_PASSWORD']
    132126
    133127        parameters = {
    134128            'dbname': TEST_NAME,
Back to Top