home
·
contact
·
privacy
projects
/
plomtask
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4907c8d
)
Add testing of Day sorting.
author
Christian Heller
<c.heller@plomlompom.de>
Sun, 17 Mar 2024 01:05:26 +0000
(
02:05
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sun, 17 Mar 2024 01:05:26 +0000
(
02:05
+0100)
tests/test_days.py
patch
|
blob
|
history
diff --git
a/tests/test_days.py
b/tests/test_days.py
index 7805208e749a664a655b97103ab3705799e062b1..02f72af140dd13cbc189af14ade4b856cf1a4c63 100644
(file)
--- a/
tests/test_days.py
+++ b/
tests/test_days.py
@@
-22,6
+22,14
@@
class DayTests(TestCase):
Day('2024-02-01 23:00:00')
self.assertEqual(datetime(2024, 1, 1), Day('2024-01-01').datetime)
+ def test_Day_sorting(self):
+ """Test Day.__lt__."""
+ day1 = Day('2024-01-01')
+ day2 = Day('2024-01-02')
+ day3 = Day('2024-01-03')
+ days = [day3, day1, day2]
+ self.assertEqual(sorted(days), [day1, day2, day3])
+
def test_Day_weekday(self):
"""Test Day.weekday."""
self.assertEqual(Day('2024-03-17').weekday, 'Sunday')