Ticket #16478: 16478.diff
File 16478.diff, 4.5 KB (added by , 13 years ago) |
---|
-
docs/ref/settings.txt
590 590 This is an Oracle-specific setting. 591 591 592 592 The username to use when connecting to the Oracle database that will be used 593 when running tests. 593 when running tests. If not provided, Django will use ``'test_' + USER``. 594 594 595 .. setting:: TEST_PASSWD 596 597 TEST_PASSWD 598 ~~~~~~~~~~~ 599 600 Default: ``None`` 601 602 This is an Oracle-specific setting. 603 604 The password to use when connecting to the Oracle database that will be used 605 when running tests. If not provided, Django will use a hardcoded default value. 606 607 .. setting:: TEST_TBLSPACE 608 609 TEST_TBLSPACE 610 ~~~~~~~~~~~~~ 611 612 Default: ``None`` 613 614 This is an Oracle-specific setting. 615 616 The name of the tablespace that will be used when running tests. If not 617 provided, Django will use ``'test_' + NAME``. 618 619 .. setting:: TEST_TBLSPACE_FILE 620 621 TEST_TBLSPACE_FILE 622 ~~~~~~~~~~~~~~~~~~ 623 624 Default: ``None`` 625 626 This is an Oracle-specific setting. 627 628 The location of the file that will store the tablespace that will be used when 629 running tests. If not provided, Django will use ``TEST_TBLSPACE + '.dbf'``. 630 631 .. setting:: TEST_TBLSPACE_TMP 632 633 TEST_TBLSPACE_TMP 634 ~~~~~~~~~~~~~~~~~ 635 636 Default: ``None`` 637 638 This is an Oracle-specific setting. 639 640 The name of the temporary tablespace that will be used when running tests. If 641 not provided, Django will use ``'test_' + NAME + '_temp'``. 642 643 .. setting:: TEST_TBLSPACE_TMP_FILE 644 645 TEST_TBLSPACE_TMP_FILE 646 ~~~~~~~~~~~~~~~~~~~~~~ 647 648 Default: ``None`` 649 650 This is an Oracle-specific setting. 651 652 The location of the file that will store the temporary tablespace that will be 653 used when running tests. If not provided, Django will use ``TEST_TBLSPACE_TMP + 654 '.dbf'``. 655 595 656 .. setting:: DATABASE_ROUTERS 596 657 597 658 DATABASE_ROUTERS -
django/db/backends/oracle/creation.py
49 49 TEST_USER = self._test_database_user() 50 50 TEST_PASSWD = self._test_database_passwd() 51 51 TEST_TBLSPACE = self._test_database_tblspace() 52 TEST_TBLSPACE_FILE = self._test_database_tblspace_file() 52 53 TEST_TBLSPACE_TMP = self._test_database_tblspace_tmp() 54 TEST_TBLSPACE_TMP_FILE = self._test_database_tblspace_tmp_file() 53 55 54 56 parameters = { 55 57 'dbname': TEST_NAME, 56 58 'user': TEST_USER, 57 59 'password': TEST_PASSWD, 58 60 'tblspace': TEST_TBLSPACE, 61 'tblspace_file': TEST_TBLSPACE_FILE, 59 62 'tblspace_temp': TEST_TBLSPACE_TMP, 63 'tblspace_temp_file': TEST_TBLSPACE_TMP_FILE, 60 64 } 61 65 62 66 self.remember['user'] = self.connection.settings_dict['USER'] … … 151 155 print "_create_test_db(): dbname = %s" % parameters['dbname'] 152 156 statements = [ 153 157 """CREATE TABLESPACE %(tblspace)s 154 DATAFILE '%(tblspace )s.dbf' SIZE 20M158 DATAFILE '%(tblspace_file)s' SIZE 20M 155 159 REUSE AUTOEXTEND ON NEXT 10M MAXSIZE 200M 156 160 """, 157 161 """CREATE TEMPORARY TABLESPACE %(tblspace_temp)s 158 TEMPFILE '%(tblspace_temp )s.dbf' SIZE 20M162 TEMPFILE '%(tblspace_temp_file)s' SIZE 20M 159 163 REUSE AUTOEXTEND ON NEXT 10M MAXSIZE 100M 160 164 """, 161 165 ] … … 245 249 pass 246 250 return name 247 251 252 def _test_database_tblspace_file(self): 253 name = self._test_database_tblspace() + '.dbf' 254 try: 255 if self.connection.settings_dict['TEST_TBLSPACE_FILE']: 256 name = self.connection.settings_dict['TEST_TBLSPACE_FILE'] 257 except KeyError: 258 pass 259 return name 260 248 261 def _test_database_tblspace_tmp(self): 249 262 name = TEST_DATABASE_PREFIX + self.connection.settings_dict['NAME'] + '_temp' 250 263 try: … … 254 267 pass 255 268 return name 256 269 270 def _test_database_tblspace_tmp_file(self): 271 name = self._test_database_tblspace_tmp() + '.dbf' 272 try: 273 if self.connection.settings_dict['TEST_TBLSPACE_TMP_FILE']: 274 name = self.connection.settings_dict['TEST_TBLSPACE_TMP_FILE'] 275 except KeyError: 276 pass 277 return name 278 257 279 def _get_test_db_name(self): 258 280 """ 259 281 We need to return the 'production' DB name to get the test DB creation