Ticket #17786: 17786-second-try.patch
File 17786-second-try.patch, 2.2 KB (added by , 13 years ago) |
---|
-
django/db/backends/oracle/creation.py
40 40 'URLField': 'VARCHAR2(%(max_length)s)', 41 41 } 42 42 43 # This dictionary stores the original values of user and passwd, which are44 # changed during the tests. It's stored at the class level because the45 # test database is created and destroyed by different connections (#17786).46 remember = {}47 48 43 def __init__(self, connection): 49 44 super(DatabaseCreation, self).__init__(connection) 50 45 … … 63 58 'tblspace_temp': TEST_TBLSPACE_TMP, 64 59 } 65 60 66 self.remember['user'] = self.connection.settings_dict['USER']67 self.remember['passwd'] = self.connection.settings_dict['PASSWORD']68 69 61 cursor = self.connection.cursor() 70 62 if self._test_database_create(): 71 63 try: … … 111 103 print "Tests cancelled." 112 104 sys.exit(1) 113 105 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 116 110 117 111 return self.connection.settings_dict['NAME'] 118 112 … … 127 121 TEST_TBLSPACE = self._test_database_tblspace() 128 122 TEST_TBLSPACE_TMP = self._test_database_tblspace_tmp() 129 123 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'] 132 126 133 127 parameters = { 134 128 'dbname': TEST_NAME,