home · contact · privacy
Slightly extend Day.by_date tests.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 20 Mar 2024 00:31:33 +0000 (01:31 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 20 Mar 2024 00:31:33 +0000 (01:31 +0100)
tests/test_days.py

index be2719318140fa52e5c53613e854a727b76d1887..3a6c6331c689b482d5a14296c4d5a07f747579ac 100644 (file)
@@ -56,6 +56,10 @@ class TestsWithDB(TestCase):
         Day('2024-01-01').save(self.db_conn)
         self.assertEqual(Day('2024-01-01'),
                          Day.by_date(self.db_conn, '2024-01-01'))
+        self.assertEqual(None,
+                         Day.by_date(self.db_conn, '2024-01-02'))
+        self.assertEqual(Day('2024-01-02'),
+                         Day.by_date(self.db_conn, '2024-01-02', create=True))
 
     def test_Day_all(self):
         """Test Day.all(), especially in regards to date range filtering."""