Skip to content

Commit fa040d0

Browse files
committed
Remove old password test
1 parent 87ee03b commit fa040d0

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

pymysql/tests/test_connection.py

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -383,58 +383,6 @@ def realTestPamAuth(self):
383383
# recreate the user
384384
cur.execute(grants)
385385

386-
# select old_password("crummy p\tassword");
387-
# | old_password("crummy p\tassword") |
388-
# | 2a01785203b08770 |
389-
@pytest.mark.skipif(not socket_auth, reason="connection to unix_socket required")
390-
@pytest.mark.skipif(
391-
not mysql_old_password_found, reason="no mysql_old_password plugin"
392-
)
393-
def testMySQLOldPasswordAuth(self):
394-
conn = self.connect()
395-
if self.mysql_server_is(conn, (5, 7, 0)):
396-
pytest.skip("Old passwords aren't supported in 5.7")
397-
# pymysql.err.OperationalError: (1045, "Access denied for user 'old_pass_user'@'localhost' (using password: YES)")
398-
# from login in MySQL-5.6
399-
if self.mysql_server_is(conn, (5, 6, 0)):
400-
pytest.skip("Old passwords don't authenticate in 5.6")
401-
db = self.db.copy()
402-
db["password"] = "crummy p\tassword"
403-
c = conn.cursor()
404-
405-
# deprecated in 5.6
406-
if self.mysql_server_is(conn, (5, 6, 0)):
407-
with self.assertWarns(pymysql.err.Warning) as cm:
408-
c.execute("SELECT OLD_PASSWORD('%s')" % db["password"])
409-
else:
410-
c.execute("SELECT OLD_PASSWORD('%s')" % db["password"])
411-
v = c.fetchone()[0]
412-
self.assertEqual(v, "2a01785203b08770")
413-
# only works in MariaDB and MySQL-5.6 - can't separate out by version
414-
# if self.mysql_server_is(self.connect(), (5, 5, 0)):
415-
# with TempUser(c, 'old_pass_user@localhost',
416-
# self.databases[0]['db'], 'mysql_old_password', '2a01785203b08770') as u:
417-
# cur = pymysql.connect(user='old_pass_user', **db).cursor()
418-
# cur.execute("SELECT VERSION()")
419-
c.execute("SELECT @@secure_auth")
420-
secure_auth_setting = c.fetchone()[0]
421-
c.execute("set old_passwords=1")
422-
# pymysql.err.Warning: 'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead
423-
if self.mysql_server_is(conn, (5, 6, 0)):
424-
with self.assertWarns(pymysql.err.Warning) as cm:
425-
c.execute("set global secure_auth=0")
426-
else:
427-
c.execute("set global secure_auth=0")
428-
with TempUser(
429-
c,
430-
"old_pass_user@localhost",
431-
self.databases[0]["db"],
432-
password=db["password"],
433-
) as u:
434-
cur = pymysql.connect(user="old_pass_user", **db).cursor()
435-
cur.execute("SELECT VERSION()")
436-
c.execute("set global secure_auth=%r" % secure_auth_setting)
437-
438386
@pytest.mark.skipif(not socket_auth, reason="connection to unix_socket required")
439387
@pytest.mark.skipif(
440388
not sha256_password_found,

0 commit comments

Comments
 (0)