]> Devi Nivas Git - chevron.git/commitdiff
Add a unittest for null values.
authornoah morrison <noah@morrison.ph>
Mon, 26 Jan 2015 20:12:05 +0000 (15:12 -0500)
committernoah morrison <noah@morrison.ph>
Mon, 26 Jan 2015 20:12:05 +0000 (15:12 -0500)
They shouldn't render at all, but they currently render as 'None'.

test_spec.py

index 3b30fc0599069b52f6152ffbc7473d2845a6b592..5c16f9e9fec0d3fe4c771e226f17d0ff21dd27dc 100755 (executable)
@@ -140,6 +140,17 @@ class ExpandedCoverage(unittest.TestCase):
 
         self.assertEqual(result, expected)
 
+    def test_null(self):
+        args = {
+            'template': '{{a}}',
+            'data': {'a': None}
+        }
+
+        result = chevron.render(**args)
+        expected = ''
+
+        self.assertEqual(result, expected)
+
 
 # Run unit tests from command line
 if __name__ == "__main__":