|
@@ -23,7 +23,11 @@ if sys.version_info.major > 2: # pragma: no cover
|
|
|
from urllib.parse import urlparse
|
|
|
else: # pragma: no cover
|
|
|
from urlparse import urlparse
|
|
|
-import MySQLdb
|
|
|
+if sys.version_info.major > 2:
|
|
|
+ import pymysql as mysql
|
|
|
+ mysql.install_as_MySQLdb()
|
|
|
+else:
|
|
|
+ import MySQLdb as mysql
|
|
|
from pwman.data.drivers.mysql import MySQLDatabase
|
|
|
from pwman.util.crypto_engine import CryptoEngine
|
|
|
|
|
@@ -49,7 +53,7 @@ class TestMySQLDatabase(unittest.TestCase):
|
|
|
self.db._con.commit()
|
|
|
|
|
|
def test_1_con(self):
|
|
|
- self.assertIsInstance(self.db._con, MySQLdb.connections.Connection)
|
|
|
+ self.assertIsInstance(self.db._con, mysql.connections.Connection)
|
|
|
|
|
|
def test_2_create_tables(self):
|
|
|
self.db._create_tables()
|