summaryrefslogtreecommitdiff
path: root/tests/test_collection.py
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-02-08 16:39:39 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-02-08 16:39:39 +0100
commita4433548c49da3140f3cda42d300803c583e7e36 (patch)
treee05b82e688e7e58dcc62ec483320fad48856cfac /tests/test_collection.py
parent4b87d38ed0300ba207faf3890123d26fa4af2609 (diff)
Add the option to autofill date and datetime fields at creation time.
Diffstat (limited to 'tests/test_collection.py')
-rw-r--r--tests/test_collection.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/test_collection.py b/tests/test_collection.py
index 9f83655..4fa292e 100644
--- a/tests/test_collection.py
+++ b/tests/test_collection.py
@@ -319,7 +319,12 @@ class testComplexCollection(unittest.TestCase):
self.assertIn('amount: 0', entry.yaml_data)
self.assertIn("tags: []", entry.yaml_data)
self.assertIn("exists:\n", entry.yaml_data)
- self.assertIn("created:\n", entry.yaml_data)
+ # we just check that created starts with a date and ends with
+ # the utc timezone to keep the regex short and manageable
+ self.assertRegex(
+ entry.yaml_data,
+ r"created: [\d]{4,4}-[\d]{2,2}-[\d]{2,2} .*\+00\:00"
+ )
self.assertIn("epoch:\n", entry.yaml_data)
def test_load_field_loaders(self):