diff --git a/src/statici18n/templatetags/statici18n.py b/src/statici18n/templatetags/statici18n.py index 121dda4..df137f7 100644 --- a/src/statici18n/templatetags/statici18n.py +++ b/src/statici18n/templatetags/statici18n.py @@ -42,4 +42,4 @@ def inlinei18n(locale): Behind the scenes, this is a thin wrapper around staticfiles's configred storage """ - return mark_safe(staticfiles_storage.open(get_path(locale)).read()) + return mark_safe(staticfiles_storage.open(get_path(locale)).read().decode()) diff --git a/tests/test_app.py b/tests/test_app.py index d05e0aa..252e114 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -1,6 +1,7 @@ import io import os import pytest +import re import django from django.core import management @@ -147,3 +148,4 @@ def test_inlinei18n_templatetag(locale): rendered = template.render(Context({'LANGUAGE_CODE': to_locale(locale)})).strip() assert 'var django = globals.django || (globals.django = {});' in rendered assert '"' not in rendered + assert re.match('^