summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2018-07-28 01:45:00 +0430
committerTim Graham <timograham@gmail.com>2018-07-27 17:15:00 -0400
commitcebbcaa1baa6eb7f9ec3e223abdc496a983ea482 (patch)
tree88cac2a77cc61830d74ff6d9a8ebeb068cb01140 /tests
parente7a56eb4f0cc1cef6c3e9e289c0f13071a534370 (diff)
Moved yesno filter test to its file.
Diffstat (limited to 'tests')
-rw-r--r--tests/template_tests/filter_tests/test_yesno.py9
-rw-r--r--tests/template_tests/syntax_tests/test_filter_syntax.py8
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):
"""