Python Normalize

import unicodedata
text = unicodedata.normalize('NFC', text)

Alchemy print query

print(q.statement.compile(compile_kwargs={"literal_binds": True}))

Source: https://stackoverflow.com/questions/4617291/how-do-i-get-a-raw-compiled-sql-query-from-a-sqlalchemy-expression

Where to patch in pytest???

https://docs.python.org/dev/library/unittest.mock.html#where-to-patch