test_helpers: Change fixture_data to text_type.

This commit is contained in:
Tim Abbott 2016-06-15 16:23:52 -07:00
parent 5b05644c95
commit b14eacd552
1 changed files with 4 additions and 3 deletions

View File

@ -8,6 +8,7 @@ from django.http import HttpResponse
from zerver.lib.initial_password import initial_password from zerver.lib.initial_password import initial_password
from zerver.lib.db import TimeTrackingCursor from zerver.lib.db import TimeTrackingCursor
from zerver.lib.handlers import allocate_handler_id from zerver.lib.handlers import allocate_handler_id
from zerver.lib.str_utils import force_text
from zerver.lib import cache from zerver.lib import cache
from zerver.lib import event_queue from zerver.lib import event_queue
from zerver.worker import queue_processors from zerver.worker import queue_processors
@ -373,9 +374,9 @@ class AuthedTestCase(TestCase):
self.assertIn(msg_substring, self.get_json_error(result, status_code=status_code)) self.assertIn(msg_substring, self.get_json_error(result, status_code=status_code))
def fixture_data(self, type, action, file_type='json'): def fixture_data(self, type, action, file_type='json'):
# type: (str, str, str) -> str # type: (text_type, text_type, text_type) -> text_type
return open(os.path.join(os.path.dirname(__file__), return force_text(open(os.path.join(os.path.dirname(__file__),
"../fixtures/%s/%s_%s.%s" % (type, type, action, file_type))).read() "../fixtures/%s/%s_%s.%s" % (type, type, action, file_type))).read())
# Subscribe to a stream directly # Subscribe to a stream directly
def subscribe_to_stream(self, email, stream_name, realm=None): def subscribe_to_stream(self, email, stream_name, realm=None):