Changeset 3673
- Timestamp:
- 08/28/06 13:59:54 (2 years ago)
- Files:
-
- django/trunk/django/test/utils.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/test/utils.py
r3658 r3673 1 1 import sys, time 2 2 from django.conf import settings 3 from django.db import connection, transaction 3 from django.db import connection, transaction, backend 4 4 5 5 # The prefix to put on the default database name when creating … … 30 30 _set_autocommit(connection) 31 31 try: 32 cursor.execute("CREATE DATABASE %s" % TEST_DATABASE_NAME)32 cursor.execute("CREATE DATABASE %s" % backend.quote_name(TEST_DATABASE_NAME)) 33 33 except Exception, e: 34 34 sys.stderr.write("Got an error creating the test database: %s\n" % e) … … 39 39 if verbosity >= 1: 40 40 print "Destroying old test database..." 41 cursor.execute("DROP DATABASE %s" % TEST_DATABASE_NAME)41 cursor.execute("DROP DATABASE %s" % backend.quote_name(TEST_DATABASE_NAME)) 42 42 if verbosity >= 1: 43 43 print "Creating test database..." 44 cursor.execute("CREATE DATABASE %s" % TEST_DATABASE_NAME)44 cursor.execute("CREATE DATABASE %s" % backend.quote_name(TEST_DATABASE_NAME)) 45 45 except Exception, e: 46 46 sys.stderr.write("Got an error recreating the test database: %s\n" % e) … … 74 74 _set_autocommit(connection) 75 75 time.sleep(1) # To avoid "database is being accessed by other users" errors. 76 cursor.execute("DROP DATABASE %s" % TEST_DATABASE_NAME)76 cursor.execute("DROP DATABASE %s" % backend.quote_name(TEST_DATABASE_NAME)) 77 77 connection.close() 78 78
