mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #29788 -- Added support for Oracle Managed File (OMF) tablespaces.
This commit is contained in:
parent
9886dffdf4
commit
ff8020ed49
4 changed files with 65 additions and 10 deletions
|
@ -74,3 +74,22 @@ class DatabaseCreationTests(TestCase):
|
|||
creation._create_test_db(verbosity=0, keepdb=False)
|
||||
with self.assertRaises(SystemExit):
|
||||
creation._create_test_db(verbosity=0, keepdb=True)
|
||||
|
||||
def test_oracle_managed_files(self, *mocked_objects):
|
||||
def _execute_capture_statements(self, cursor, statements, parameters, verbosity, allow_quiet_fail=False):
|
||||
self.tblspace_sqls = statements
|
||||
|
||||
creation = DatabaseCreation(connection)
|
||||
# Simulate test database creation with Oracle Managed File (OMF)
|
||||
# tablespaces.
|
||||
with mock.patch.object(DatabaseCreation, '_test_database_oracle_managed_files', return_value=True):
|
||||
with self.patch_execute_statements(_execute_capture_statements):
|
||||
with connection.cursor() as cursor:
|
||||
creation._execute_test_db_creation(cursor, creation._get_test_db_params(), verbosity=0)
|
||||
tblspace_sql, tblspace_tmp_sql = creation.tblspace_sqls
|
||||
# Datafile names shouldn't appear.
|
||||
self.assertIn('DATAFILE SIZE', tblspace_sql)
|
||||
self.assertIn('TEMPFILE SIZE', tblspace_tmp_sql)
|
||||
# REUSE cannot be used with OMF.
|
||||
self.assertNotIn('REUSE', tblspace_sql)
|
||||
self.assertNotIn('REUSE', tblspace_tmp_sql)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue