Michael Manfre avatar Michael Manfre committed 44f7ce1

Update database creation to use new settings.DATABASES

Comments (0)

Files changed (1)

sqlserver_ado/creation.py

             print "Skipping Test DB destruction"    
         
     def _test_database_create(self, settings):
+        if self.connection.settings_dict.has_key('TEST_CREATE'):
+            return self.connection.settings_dict.get('TEST_CREATE', True)
         if hasattr(settings, 'TEST_DATABASE_CREATE'):
             return settings.TEST_DATABASE_CREATE
         else:
             return True
 
     def _test_database_name(self, settings):
-        if hasattr(settings, 'TEST_DATABASE_NAME') and settings.TEST_DATABASE_NAME:
-            return settings.TEST_DATABASE_NAME
-        else:
-            return TEST_DATABASE_PREFIX + settings.DATABASE_NAME
+        try:
+            name = TEST_DATABASE_PREFIX + self.connection.settings_dict['NAME']
+            if self.connection.settings_dict['TEST_NAME']:
+                name = self.connection.settings_dict['TEST_NAME']
+        except AttributeError:
+            if hasattr(settings, 'TEST_DATABASE_NAME') and settings.TEST_DATABASE_NAME:
+                name = settings.TEST_DATABASE_NAME
+            else:
+                name = TEST_DATABASE_PREFIX + settings.DATABASE_NAME
+        return name
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.