'Test that last_executed_query() returns an Unicode string'

def test_query_encoding(self):

    persons = models.Reporter.objects.filter(raw_data='\x00F        \xfe').extra(select={u'f\xf6\xf6': 1})
    (sql, params) = persons.query.sql_with_params()
    cursor = persons.query.get_compiler(u'default').execute_sql(None)
    last_sql = cursor.db.ops.last_executed_query(cursor, sql, params)
    self.assertIsInstance(last_sql, six.text_type)
