diff options
| author | Tim Graham <timograham@gmail.com> | 2015-02-14 19:47:07 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-02-17 19:03:03 -0500 |
| commit | 307c0f299a6c26f5231d3516df5b4edc54b36553 (patch) | |
| tree | 3c80c8cb475846c0dff45188db1db111249df97f /tests/test_runner/test_debug_sql.py | |
| parent | fa66ea75326e669cd3d51fb926a4364b8ba08959 (diff) | |
Refs #24324 -- Fixed Python 2 test failures when path to Django source contains non-ASCII characters.
Diffstat (limited to 'tests/test_runner/test_debug_sql.py')
| -rw-r--r-- | tests/test_runner/test_debug_sql.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_runner/test_debug_sql.py b/tests/test_runner/test_debug_sql.py index cc583cbb37..fa7c7f7401 100644 --- a/tests/test_runner/test_debug_sql.py +++ b/tests/test_runner/test_debug_sql.py @@ -5,6 +5,7 @@ from django.db import connection from django.test import TestCase from django.test.runner import DiscoverRunner from django.utils import six +from django.utils.encoding import force_text from .models import Person @@ -42,8 +43,9 @@ class TestDebugSQL(unittest.TestCase): ).run(suite) runner.teardown_databases(old_config) - stream.seek(0) - return stream.read() + if six.PY2: + stream.buflist = [force_text(x) for x in stream.buflist] + return stream.getvalue() def test_output_normal(self): full_output = self._test_output(1) |
