2018-03-21 07:20:04 +00:00
|
|
|
from template_tests.utils import setup
|
|
|
|
|
|
|
|
from django.template import TemplateSyntaxError
|
|
|
|
from django.test import SimpleTestCase
|
|
|
|
|
|
|
|
|
|
|
|
class I18nLanguageTagTests(SimpleTestCase):
|
2022-02-03 19:24:19 +00:00
|
|
|
libraries = {"i18n": "django.templatetags.i18n"}
|
2018-03-21 07:20:04 +00:00
|
|
|
|
2022-02-03 19:24:19 +00:00
|
|
|
@setup({"i18n_language": "{% load i18n %} {% language %} {% endlanguage %}"})
|
2018-03-21 07:20:04 +00:00
|
|
|
def test_no_arg(self):
|
2022-02-03 19:24:19 +00:00
|
|
|
with self.assertRaisesMessage(
|
|
|
|
TemplateSyntaxError, "'language' takes one argument (language)"
|
|
|
|
):
|
|
|
|
self.engine.render_to_string("i18n_language")
|