Skip to content

Commit

Permalink
fix: test_sort_pending
Browse files Browse the repository at this point in the history
  • Loading branch information
kraanzu committed Nov 14, 2024
1 parent 3713f59 commit 0e20272
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/test_core/test_todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,9 @@ def _sort_before_and_after(self, field) -> Tuple[List[Todo], List[Todo]]:
return old_todos, new_descriptions

def test_sort_pending(self):
_, new = self._sort_before_and_after("pending")
values_dict = {"completed": 3, "pending": 2, "overdue": 1}
values = [values_dict[t.status] for t in new]

self.assertEqual(values, sorted(values))
old, new = self._sort_before_and_after("pending")
old.sort(key=lambda x: (not x.pending, x.due or datetime.max, x.order_index))
self.assertEqual([i.id for i in old], [i.id for i in new])

def test_sort_description(self):
old, new = self._sort_before_and_after("description")
Expand Down

0 comments on commit 0e20272

Please sign in to comment.