Skip to content

Commit

Permalink
Merge pull request #44 from outloudvi/patch-1
Browse files Browse the repository at this point in the history
Fix python3 compatibility about inlinei18n
  • Loading branch information
Sébastien Fievet committed Mar 3, 2019
2 parents b5113e9 + c42b79f commit f95a6d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/statici18n/templatetags/statici18n.py
Expand Up @@ -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())
2 changes: 2 additions & 0 deletions tests/test_app.py
@@ -1,6 +1,7 @@
import io
import os
import pytest
import re

import django
from django.core import management
Expand Down Expand Up @@ -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('^<script>(r|b)\'', rendered) is None

0 comments on commit f95a6d8

Please sign in to comment.