Add started status to task order model

This commit is contained in:
Patrick Smith 2019-02-12 21:27:53 -05:00
parent aa0a27aaa0
commit ba3000dccc
3 changed files with 9 additions and 5 deletions

View File

@ -21,6 +21,7 @@ from atst.models import Attachment, Base, types, mixins
class Status(Enum):
STARTED = "Started"
PENDING = "Pending"
ACTIVE = "Active"
EXPIRED = "Expired"
@ -142,7 +143,7 @@ class TaskOrder(Base, mixins.TimestampsMixin):
return Status.EXPIRED
return Status.ACTIVE
else:
return Status.PENDING
return Status.STARTED
@property
def display_status(self):

View File

@ -75,7 +75,7 @@
width: 100%;
}
.label--pending {
.label--pending, .label--started {
background-color: $color-gold;
}

View File

@ -9,11 +9,14 @@ from tests.mocks import PDF_FILENAME
class TestTaskOrderStatus:
def test_pending_status(self):
def test_started_status(self):
to = TaskOrder()
assert to.status == Status.PENDING
assert to.status == Status.STARTED
to = TaskOrder(number="42", start_date=random_future_date())
def test_pending_status(self):
to = TaskOrder(
number="42", start_date=random_future_date(), end_date=random_future_date()
)
assert to.status == Status.PENDING
def test_active_status(self):