Remove unsigned from the display statuses, show unsigned TOs display status as DRAFT
This commit is contained in:
parent
adaa201f25
commit
ff82e39626
@ -25,7 +25,6 @@ SORT_ORDERING = [
|
|||||||
Status.DRAFT,
|
Status.DRAFT,
|
||||||
Status.UPCOMING,
|
Status.UPCOMING,
|
||||||
Status.EXPIRED,
|
Status.EXPIRED,
|
||||||
Status.UNSIGNED,
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@ -148,7 +147,10 @@ class TaskOrder(Base, mixins.TimestampsMixin):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def display_status(self):
|
def display_status(self):
|
||||||
return self.status.value
|
if self.status == Status.UNSIGNED:
|
||||||
|
return Status.DRAFT.value
|
||||||
|
else:
|
||||||
|
return self.status.value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def portfolio_name(self):
|
def portfolio_name(self):
|
||||||
|
@ -149,11 +149,12 @@ def test_task_order_sort_by_status():
|
|||||||
]
|
]
|
||||||
|
|
||||||
sorted_by_status = TaskOrders.sort_by_status(initial_to_list)
|
sorted_by_status = TaskOrders.sort_by_status(initial_to_list)
|
||||||
assert len(sorted_by_status["Draft"]) == 3
|
assert len(sorted_by_status["Draft"]) == 4
|
||||||
assert len(sorted_by_status["Active"]) == 1
|
assert len(sorted_by_status["Active"]) == 1
|
||||||
assert len(sorted_by_status["Upcoming"]) == 1
|
assert len(sorted_by_status["Upcoming"]) == 1
|
||||||
assert len(sorted_by_status["Expired"]) == 2
|
assert len(sorted_by_status["Expired"]) == 2
|
||||||
assert len(sorted_by_status["Unsigned"]) == 1
|
with pytest.raises(KeyError):
|
||||||
|
sorted_by_status["Unsigned"]
|
||||||
assert list(sorted_by_status.keys()) == [status.value for status in SORT_ORDERING]
|
assert list(sorted_by_status.keys()) == [status.value for status in SORT_ORDERING]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user