mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Avoided using BinaryField unecessarily in tests.
Several database backends struggle with binary data. This change
minimizes the risk of unrelated tests failures when binary fields
trigger errors.
Forward-port of 2e4bcb9b from stable/1.7.x.
This commit is contained in:
@@ -334,9 +334,9 @@ class LastExecutedQueryTest(TestCase):
|
||||
"""
|
||||
Test that last_executed_query() returns an Unicode string
|
||||
"""
|
||||
persons = models.Reporter.objects.filter(raw_data=b'\x00\x46 \xFE').extra(select={'föö': 1})
|
||||
sql, params = persons.query.sql_with_params()
|
||||
cursor = persons.query.get_compiler('default').execute_sql(CURSOR)
|
||||
data = models.RawData.objects.filter(raw_data=b'\x00\x46 \xFE').extra(select={'föö': 1})
|
||||
sql, params = data.query.sql_with_params()
|
||||
cursor = data.query.get_compiler('default').execute_sql(CURSOR)
|
||||
last_sql = cursor.db.ops.last_executed_query(cursor, sql, params)
|
||||
self.assertIsInstance(last_sql, six.text_type)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user