From 98a1295f76677ffffb640dfb534c398da1265e9e Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Sun, 10 Jan 2021 11:33:37 +0100 Subject: Testing indexing entries with ' in the string/text fields --- .../data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml | 11 +++++++++++ tests/test_collection.py | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml diff --git a/tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml b/tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml new file mode 100644 index 0000000..e210cdf --- /dev/null +++ b/tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml @@ -0,0 +1,11 @@ +name: "An item with a ' in the name" +description: | + This is an item with ' inside the strings. +position: 'Somewhere' +something: +tags: + - the ' +keywords: [] +exists: +with_default: 'default value' +amount: 0 diff --git a/tests/test_collection.py b/tests/test_collection.py index 850ac27..4668096 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -279,7 +279,8 @@ class testComplexCollection(unittest.TestCase): self.assertEqual(len(self.collection.indexed_fields), 7) def test_index(self): - self.collection.update_cache() + indexed = self.collection.update_cache() + self.assertEqual(indexed, 9) def test_indexing_list(self): self.collection.update_cache(['73097121f1874a6ea2f927db7dc4f11e.yaml']) -- cgit v1.2.3