(pgconn)
| 725 | @pytest.mark.libpq(">= 10") |
| 726 | @pytest.mark.crdb_skip("password_encryption") |
| 727 | def test_encrypt_password_query(pgconn): |
| 728 | res = pgconn.exec_(b"set password_encryption to 'md5'") |
| 729 | assert res.status == pq.ExecStatus.COMMAND_OK, pgconn.get_error_message() |
| 730 | enc = pgconn.encrypt_password(b"psycopg2", b"ashesh") |
| 731 | assert enc == b"md594839d658c28a357126f105b9cb14cfc" |
| 732 | |
| 733 | res = pgconn.exec_(b"set password_encryption to 'scram-sha-256'") |
| 734 | assert res.status == pq.ExecStatus.COMMAND_OK |
| 735 | enc = pgconn.encrypt_password(b"psycopg2", b"ashesh") |
| 736 | assert enc.startswith(b"SCRAM-SHA-256$") |
| 737 | |
| 738 | |
| 739 | @pytest.mark.libpq(">= 10") |
nothing calls this directly
no test coverage detected