diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2021-02-10 09:32:37 +0100 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2021-02-10 09:32:37 +0100 |
commit | 836b4106aeef9acd30a4fd4dbca00c5d90e9aef7 (patch) | |
tree | eed85d2ef57efee4a6332755c8bdbfe72a7dc18e /tests/test_collection.py | |
parent | 8579962d017c4ec46d731b852353d38e4fb031df (diff) |
Add the option to autoincrement integer values
Diffstat (limited to 'tests/test_collection.py')
-rw-r--r-- | tests/test_collection.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/test_collection.py b/tests/test_collection.py index 527acf9..84c535d 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -297,7 +297,7 @@ class testComplexCollection(unittest.TestCase): self.collection.settings['name'], "Fully featured lesana collection", ) - self.assertEqual(len(self.collection.settings['fields']), 13) + self.assertEqual(len(self.collection.settings['fields']), 14) self.assertIsNotNone(self.collection.stemmer) self.assertEqual(len(self.collection.indexed_fields), 8) @@ -424,21 +424,24 @@ class testComplexCollection(unittest.TestCase): eid = '5084bc6e94f24dc6976629282ef30419' entry = self.collection.entry_from_eid(eid) # we keep the old data, and check that the updated field is - # empty + # empty and the version field is 0 old_data = entry.data.copy() self.assertEqual(entry.data['updated'], None) + self.assertEqual(entry.data['version'], 0) entry.update() # after the update, fields that were not supposed to be updated # are equal to what they were before, while updated has been # changed to a datetime in this year (we don't check too deeply - # to avoid breaking tests too often with race conditions). + # to avoid breaking tests too often with race conditions) and + # version has grown to 2. for field in ('created', 'epoch'): self.assertEqual(old_data[field], entry.data[field]) now = datetime.datetime.now(datetime.timezone.utc) self.assertIsInstance(entry.data['updated'], datetime.datetime) self.assertEqual(entry.data['updated'].year, now.year) + self.assertEqual(entry.data['version'], 2) class testCollectionWithErrors(unittest.TestCase): |