diff options
Diffstat (limited to 'tests/test_collection.py')
-rw-r--r-- | tests/test_collection.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_collection.py b/tests/test_collection.py index e732f9c..9e3df7c 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -109,6 +109,20 @@ class testEntries(unittest.TestCase): self.assertIsInstance(written['name'], str) os.remove(entry_fname) + def test_entry_representation(self): + uid = '11189ee47ddf4796b718a483b379f976' + entry = self.collection.entry_from_uid(uid) + self.assertEqual( + str(entry), + uid + ) + label = '{{ uid }}: {{ name }}' + self.collection.settings['entry_label'] = label + self.assertEqual( + str(entry), + '{uid}: {name}'.format(uid=uid, name='Another item') + ) + class testComplexCollection(unittest.TestCase): @classmethod |