Kaydet (Commit) e7e991e8 authored tarafından Adrian Holovaty's avatar Adrian Holovaty

Fixed #964 -- Added helpful error message if there's a problem in running the…

Fixed #964 -- Added helpful error message if there's a problem in running the unit tests. Thanks, paolo.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1520 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 3bf29d21
...@@ -100,8 +100,9 @@ class TestRunner: ...@@ -100,8 +100,9 @@ class TestRunner:
self.output(1, "Creating test database") self.output(1, "Creating test database")
try: try:
cursor.execute("CREATE DATABASE %s" % TEST_DATABASE_NAME) cursor.execute("CREATE DATABASE %s" % TEST_DATABASE_NAME)
except: except Exception, e:
confirm = raw_input("The test database, %s, already exists. Type 'yes' to delete it, or 'no' to cancel: " % TEST_DATABASE_NAME) sys.stderr.write("Got an error creating the test database: %s\n" % e)
confirm = raw_input("It appears the test database, %s, already exists. Type 'yes' to delete it, or 'no' to cancel: " % TEST_DATABASE_NAME)
if confirm == 'yes': if confirm == 'yes':
cursor.execute("DROP DATABASE %s" % TEST_DATABASE_NAME) cursor.execute("DROP DATABASE %s" % TEST_DATABASE_NAME)
cursor.execute("CREATE DATABASE %s" % TEST_DATABASE_NAME) cursor.execute("CREATE DATABASE %s" % TEST_DATABASE_NAME)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment