X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=tests%2Fdays.py;h=055616480e7b8df3392badd41fe1b49fc818dbdf;hb=f79031c51b888d66448d18b159f17fbe28c7885c;hp=41bcf9ce11a7db458ed5c03ce2b3f3abf9150722;hpb=e06d3b744f88b2976399b0cbe08b526bb7e88907;p=plomtask diff --git a/tests/days.py b/tests/days.py index 41bcf9c..0556164 100644 --- a/tests/days.py +++ b/tests/days.py @@ -42,8 +42,12 @@ class TestsWithDB(TestCaseWithDB): checked_class = Day default_ids = ('2024-01-01', '2024-01-02', '2024-01-03') - def test_Day_saving_and_caching(self) -> None: - """Test .save/.save_core.""" + def test_saving_and_caching(self) -> None: + """Test storage of instances. + + We don't use the parent class's method here because the checked class + has too different a handling of IDs. + """ kwargs = {'date': self.default_ids[0], 'comment': 'foo'} self.check_saving_and_caching(**kwargs) @@ -77,13 +81,13 @@ class TestsWithDB(TestCaseWithDB): []) # check fill_gaps= instantiates unsaved dates within date range # (but does not store them) - day4 = Day('2024-01-04') day5 = Day('2024-01-05') day6 = Day('2024-01-06') day6.save(self.db_conn) - self.assertEqual(Day.all(self.db_conn, (date2, '2024-01-07'), + day7 = Day('2024-01-07') + self.assertEqual(Day.all(self.db_conn, (day5.date, day7.date), fill_gaps=True), - [day2, day3, day4, day5, day6]) + [day5, day6, day7]) self.check_storage([day1, day2, day3, day6]) # check 'today' is interpreted as today's date today = Day(todays_date())