X-Git-Url: https://git.mdrn.pl/fnpdjango.git/blobdiff_plain/e4707d78bf213a6634de0a8ad6ec0c2ebdd6de82..28b1d7e9f4a7008712736adce363ca2770d48aea:/tests/tests/test_templatetags_macros.py diff --git a/tests/tests/test_templatetags_macros.py b/tests/tests/test_templatetags_macros.py new file mode 100644 index 0000000..8fd7823 --- /dev/null +++ b/tests/tests/test_templatetags_macros.py @@ -0,0 +1,19 @@ +from __future__ import unicode_literals + +from django.test import TestCase +from django.template import Template, Context + + +class MacrosTests(TestCase): + def test_macro(self): + tmpl = Template(""" + {% load macros %} + {% macro my_macro arg1 %} + Parameter: {{ arg1 }}
+ {% endmacro %} + {% usemacro my_macro "String parameter" %} + """) + self.assertEqual( + tmpl.render(Context()).strip(), + "Parameter: String parameter
" + )