()
| 177 | |
| 178 | |
| 179 | def test_mogrify_with_dict_args(): |
| 180 | conn = connect() |
| 181 | cursor = conn.cursor() |
| 182 | |
| 183 | query_with_args = "SELECT %(a)s, %(b)s", {"a": 1, "b": 2} |
| 184 | mogrified_query = cursor.mogrify(*query_with_args) |
| 185 | cursor.execute(*query_with_args) |
| 186 | |
| 187 | assert mogrified_query == "SELECT 1, 2" |
| 188 | assert mogrified_query == cursor._executed.decode() |
| 189 | |
| 190 | |
| 191 | # Test that cursor can be used without reading whole resultset. |