2014-12-04 04:36:17 +08:00
|
|
|
from django.test import SimpleTestCase
|
2014-11-12 09:32:44 +08:00
|
|
|
|
2014-12-07 16:43:10 +08:00
|
|
|
from ..utils import setup
|
2014-11-12 09:32:44 +08:00
|
|
|
|
|
|
|
|
2014-12-04 04:36:17 +08:00
|
|
|
class BuiltinsTests(SimpleTestCase):
|
2014-11-12 09:32:44 +08:00
|
|
|
|
|
|
|
@setup({'builtins01': '{{ True }}'})
|
|
|
|
def test_builtins01(self):
|
2014-12-07 16:43:10 +08:00
|
|
|
output = self.engine.render_to_string('builtins01')
|
|
|
|
self.assertEqual(output, 'True')
|
2014-11-12 09:32:44 +08:00
|
|
|
|
|
|
|
@setup({'builtins02': '{{ False }}'})
|
|
|
|
def test_builtins02(self):
|
2014-12-07 16:43:10 +08:00
|
|
|
output = self.engine.render_to_string('builtins02')
|
|
|
|
self.assertEqual(output, 'False')
|
2014-11-12 09:32:44 +08:00
|
|
|
|
|
|
|
@setup({'builtins03': '{{ None }}'})
|
|
|
|
def test_builtins03(self):
|
2014-12-07 16:43:10 +08:00
|
|
|
output = self.engine.render_to_string('builtins03')
|
|
|
|
self.assertEqual(output, 'None')
|