diff --git a/HISTORY.rst b/HISTORY.rst index ffa3047cc6..e64f02b785 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,7 +1,14 @@ +3.1.3 (2018-09-26) +================== +* Make sure template API renders in non US languages. + + 3.1.2 (2018-09-21) ================== -* Database access in data migrations defaults to the 'default' database. Force it to the user selected database instead. -* Don't use a hardcoded database alias for the destination of the database conversion. +* Database access in data migrations defaults to the 'default' database. + Force it to the user selected database instead. +* Don't use a hardcoded database alias for the destination of the database + conversion. * Improve natural key support in the UserOptions model. * Update from Django 1.11.11 to 1.11.15. * Add support to the convertdb command to operate on specified apps too. @@ -11,7 +18,8 @@ * Add support for natural keys to the DocumentPageImageCache model. * Add database conversion test to the common app. * Fix label display for resolved smart links when not using a dynamic label. -* Only show smart link resolution errors to the user with the smart link edit permission. +* Only show smart link resolution errors to the user with the smart link edit + permission. * Intercept document list view exception and display them as an error message. 3.1.1 (2018-09-18) diff --git a/mayan/apps/common/classes.py b/mayan/apps/common/classes.py index 450c3e134f..576aa286d3 100644 --- a/mayan/apps/common/classes.py +++ b/mayan/apps/common/classes.py @@ -393,7 +393,7 @@ class Template(object): context=context, ).render() - self.html = result.content + self.html = result.rendered_content self.hex_hash = hashlib.sha256(result.content).hexdigest() return self diff --git a/mayan/apps/common/tests/test_api.py b/mayan/apps/common/tests/test_api.py index e28c22d6af..e6bb91f5c6 100644 --- a/mayan/apps/common/tests/test_api.py +++ b/mayan/apps/common/tests/test_api.py @@ -1,11 +1,20 @@ from __future__ import unicode_literals from django.urls import reverse +from django.test import override_settings from rest_api.tests import BaseAPITestCase +from ..classes import Template + class CommonAPITestCase(BaseAPITestCase): def test_content_type_list_view(self): response = self.client.get(reverse('rest_api:content-type-list')) self.assertEqual(response.status_code, 200) + + @override_settings(LANGUAGE_CODE='de') + def test_template_detail_view(self): + template_main_menu = Template.get(name='main_menu') + response = self.client.get(template_main_menu.get_absolute_url()) + self.assertEqual(response.status_code, 200)