(self)
| 955 | self.assertEqual(con.escape(Foo(), mapping), "bar") |
| 956 | |
| 957 | def test_escape_fallback_encoder(self): |
| 958 | con = self.connect() |
| 959 | |
| 960 | class Custom(str): |
| 961 | pass |
| 962 | |
| 963 | mapping = {str: pymysql.converters.escape_string} |
| 964 | self.assertEqual(con.escape(Custom("foobar"), mapping), "'foobar'") |
| 965 | |
| 966 | def test_escape_no_default(self): |
| 967 | con = self.connect() |