diff options
Diffstat (limited to 'tests/test_collection.py')
-rw-r--r-- | tests/test_collection.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/test_collection.py b/tests/test_collection.py index 09ff96c..4160c5e 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -260,6 +260,11 @@ class testEntries(unittest.TestCase): res = entry.render('tests/data/simple/templates/trivial_template.txt') self.assertIn(uid, res) + def test_empty_data(self): + entry = lesana.Entry(self.collection) + self.assertIn("name: ''", entry.yaml_data) + self.assertIn('quantity: 0', entry.yaml_data) + class testComplexCollection(unittest.TestCase): @classmethod @@ -276,7 +281,7 @@ class testComplexCollection(unittest.TestCase): self.collection.settings['name'], "Fully featured lesana collection" ) - self.assertEqual(len(self.collection.settings['fields']), 7) + self.assertEqual(len(self.collection.settings['fields']), 9) self.assertIsNotNone(self.collection.stemmer) self.assertEqual(len(self.collection.indexed_fields), 6) @@ -298,6 +303,13 @@ class testComplexCollection(unittest.TestCase): ) self.assertIsInstance(entry.data['exists'], bool) + def test_empty_data(self): + entry = lesana.Entry(self.collection) + print(entry.yaml_data) + self.assertIn("name: ''", entry.yaml_data) + self.assertIn('with_default', entry.yaml_data) + self.assertIn('amount: 0', entry.yaml_data) + class testCollectionWithErrors(unittest.TestCase): @classmethod |