From cebbcaa1baa6eb7f9ec3e223abdc496a983ea482 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Sat, 28 Jul 2018 01:45:00 +0430 Subject: [PATCH] Moved yesno filter test to its file. --- tests/template_tests/filter_tests/test_yesno.py | 9 +++++++++ tests/template_tests/syntax_tests/test_filter_syntax.py | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/template_tests/filter_tests/test_yesno.py b/tests/template_tests/filter_tests/test_yesno.py index c496a600ee..70b383a2b6 100644 --- a/tests/template_tests/filter_tests/test_yesno.py +++ b/tests/template_tests/filter_tests/test_yesno.py @@ -1,6 +1,15 @@ from django.template.defaultfilters import yesno from django.test import SimpleTestCase +from ..utils import setup + + +class YesNoTests(SimpleTestCase): + @setup({'t': '{{ var|yesno:"yup,nup,mup" }} {{ var|yesno }}'}) + def test_true(self): + output = self.engine.render_to_string('t', {'var': True}) + self.assertEqual(output, 'yup yes') + class FunctionTests(SimpleTestCase): diff --git a/tests/template_tests/syntax_tests/test_filter_syntax.py b/tests/template_tests/syntax_tests/test_filter_syntax.py index 176475c04c..f6f2857df8 100644 --- a/tests/template_tests/syntax_tests/test_filter_syntax.py +++ b/tests/template_tests/syntax_tests/test_filter_syntax.py @@ -109,14 +109,6 @@ class FilterSyntaxTests(SimpleTestCase): output = self.engine.render_to_string('filter-syntax11', {"var": None, "var2": "happy"}) self.assertEqual(output, 'happy') - @setup({'filter-syntax12': r'{{ var|yesno:"yup,nup,mup" }} {{ var|yesno }}'}) - def test_filter_syntax12(self): - """ - Default argument testing - """ - output = self.engine.render_to_string('filter-syntax12', {"var": True}) - self.assertEqual(output, 'yup yes') - @setup({'filter-syntax13': r'1{{ var.method3 }}2'}) def test_filter_syntax13(self): """