summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-01-02 18:59:29 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-01-02 18:59:29 +0100
commit76849e6374f2ebf2a1df2ac142a150f82bf2e472 (patch)
tree56a73b48146d1bdfd07a754331855b1c0b885479 /tests
parent97a6ff92674a74a92050ae29e3606cb219b3ed93 (diff)
Custom label for entries
Diffstat (limited to 'tests')
-rw-r--r--tests/test_collection.py14
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