Skip to content

Commit aa28721

Browse files
authored
Use utf8mb4 in test_binary_prefix (#501)
1 parent 4bb85b2 commit aa28721

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: tests/test_MySQLdb_capabilities.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,19 @@ def test_binary_prefix(self):
182182
for binary_prefix in (True, False, None):
183183
kwargs = self.connect_kwargs.copy()
184184
# needs to be set to can guarantee CHARSET response for normal strings
185-
kwargs["charset"] = "utf8"
185+
kwargs["charset"] = "utf8mb4"
186186
if binary_prefix is not None:
187187
kwargs["binary_prefix"] = binary_prefix
188188

189189
with closing(connection_factory(**kwargs)) as conn:
190190
with closing(conn.cursor()) as c:
191191
c.execute("SELECT CHARSET(%s)", (MySQLdb.Binary(b"raw bytes"),))
192192
self.assertEqual(
193-
c.fetchall()[0][0], "binary" if binary_prefix else "utf8"
193+
c.fetchall()[0][0], "binary" if binary_prefix else "utf8mb4"
194194
)
195195
# normal strings should not get prefix
196196
c.execute("SELECT CHARSET(%s)", ("str",))
197-
self.assertEqual(c.fetchall()[0][0], "utf8")
197+
self.assertEqual(c.fetchall()[0][0], "utf8mb4")
198198

199199

200200
if __name__ == "__main__":

0 commit comments

Comments
 (0)