diff options
| author | Michael Newman <newmaniese@gmail.com> | 2012-05-27 21:51:03 +0300 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2012-05-27 21:51:03 +0300 |
| commit | 0f69a16785b88d03dc246a652cf348e0f2704e8e (patch) | |
| tree | 7ae740d2b90731d16529112b241cc1fe9e329634 /tests | |
| parent | d3fa8d92ea1b5c2404d5f750bf7efd5461840bf7 (diff) | |
[1.4.x] Fixed #18135 -- Close connection used for db version checking
On MySQL when checking the server version, a new connection could be
created but never closed. This could result in open connections on
server startup.
Backport of 4423757c0c50afbe2470434778c8d5e5b4a70925.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/backends/tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py index cfb662ee80..193d01b7e6 100644 --- a/tests/regressiontests/backends/tests.py +++ b/tests/regressiontests/backends/tests.py @@ -65,6 +65,14 @@ class OracleChecks(unittest.TestCase): self.assertEqual(connection.connection.encoding, "UTF-8") self.assertEqual(connection.connection.nencoding, "UTF-8") +class MySQLTests(TestCase): + @unittest.skipUnless(connection.vendor == 'mysql', + "Test valid only for MySQL") + def test_server_version_connections(self): + connection.close() + connection.get_server_version() + self.assertTrue(connection.connection is None) + class DateQuotingTest(TestCase): def test_django_date_trunc(self): |
