diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-01-07 19:53:20 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-01-07 19:53:20 +0000 |
| commit | ca187fea88b626508e125e0843c991fe63f8ed95 (patch) | |
| tree | 36a4918e9917cf4f050c30321dac73e6cd4c4c20 /tests | |
| parent | f46003559cc59d27df7a4926001fd10b84f4ab22 (diff) | |
Fixed #17513 -- Prevented the MySQL backend from leaking MySQLdb-specific exceptions. Thanks Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17352 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/backends/tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py index b561b4eb2d..436da8c2d0 100644 --- a/tests/regressiontests/backends/tests.py +++ b/tests/regressiontests/backends/tests.py @@ -351,6 +351,12 @@ class BackendTestCase(TestCase): self.assertTrue(hasattr(connection.ops, 'connection')) self.assertEqual(connection, connection.ops.connection) + def test_duplicate_table_error(self): + """ Test that creating an existing table returns a DatabaseError """ + cursor = connection.cursor() + query = 'CREATE TABLE %s (id INTEGER);' % models.Article._meta.db_table + with self.assertRaises(DatabaseError): + cursor.execute(query) # We don't make these tests conditional because that means we would need to # check and differentiate between: |
