1
0
mirror of https://github.com/django/django.git synced 2025-10-25 06:36:07 +00:00

[py3] Used six.StringIO to simulate stdout buffer in tests

This commit is contained in:
Claude Paroz
2012-08-11 18:56:14 +02:00
parent 09c589810d
commit 3eb28d0119
4 changed files with 13 additions and 15 deletions

View File

@@ -1,11 +1,11 @@
import copy
import sys
from io import BytesIO
from django.core.management.validation import get_validation_errors
from django.db.models.loading import cache, load_app
from django.utils import unittest
from django.utils.six import StringIO
class InvalidModelTestCase(unittest.TestCase):
@@ -16,7 +16,7 @@ class InvalidModelTestCase(unittest.TestCase):
# coloring attached (makes matching the results easier). We restore
# sys.stderr afterwards.
self.old_stdout = sys.stdout
self.stdout = BytesIO()
self.stdout = StringIO()
sys.stdout = self.stdout
# This test adds dummy applications to the app cache. These