MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / test_issue_15

Method test_issue_15

pymysql/tests/test_issues.py:113–126  ·  view source on GitHub ↗

query should be expanded before perform character encoding

(self)

Source from the content-addressed store, hash-verified

111 cur.execute("drop table issue13")
112
113 def test_issue_15(self):
114 """query should be expanded before perform character encoding"""
115 conn = self.connect()
116 c = conn.cursor()
117 with warnings.catch_warnings():
118 warnings.filterwarnings("ignore")
119 c.execute("drop table if exists issue15")
120 c.execute("create table issue15 (t varchar(32))")
121 try:
122 c.execute("insert into issue15 (t) values (%s)", ("\xe4\xf6\xfc",))
123 c.execute("select t from issue15")
124 self.assertEqual("\xe4\xf6\xfc", c.fetchone()[0])
125 finally:
126 c.execute("drop table issue15")
127
128 def test_issue_16(self):
129 """Patch for string and tuple escaping"""

Callers

nothing calls this directly

Calls 4

cursorMethod · 0.80
executeMethod · 0.80
connectMethod · 0.45
fetchoneMethod · 0.45

Tested by

no test coverage detected