Add started status to task order model
This commit is contained in:
parent
aa0a27aaa0
commit
ba3000dccc
@ -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):
|
||||
|
@ -75,7 +75,7 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.label--pending {
|
||||
.label--pending, .label--started {
|
||||
background-color: $color-gold;
|
||||
}
|
||||
|
||||
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user