Delete things related to deleted columns and table

This commit is contained in:
leigh-mil
2019-05-30 15:42:06 -04:00
parent fbfb04d763
commit 7bec073f78
27 changed files with 69 additions and 2374 deletions

View File

@@ -9,79 +9,27 @@ from tests.mocks import PDF_FILENAME
class TestTaskOrderStatus:
@pytest.mark.skip(reason="Reimplement after adding CLINs")
def test_started_status(self):
to = TaskOrder()
assert to.status == Status.STARTED
@pytest.mark.skip(reason="See if still needed after implementing CLINs")
def test_pending_status(self):
to = TaskOrder(
number="42", start_date=random_future_date(), end_date=random_future_date()
)
to = TaskOrder(number="42")
assert to.status == Status.PENDING
@pytest.mark.skip(reason="See if still needed after implementing CLINs")
def test_active_status(self):
to = TaskOrder(
number="42", start_date=random_past_date(), end_date=random_future_date()
)
to = TaskOrder(number="42")
assert to.status == Status.ACTIVE
@pytest.mark.skip(reason="See if still needed after implementing CLINs")
def test_expired_status(self):
to = TaskOrder(
number="42", start_date=random_past_date(), end_date=random_past_date()
)
to = TaskOrder(number="42")
assert to.status == Status.EXPIRED
def test_is_submitted():
to = TaskOrder()
assert not to.is_submitted
to = TaskOrder(
number="42",
start_date=datetime.date.today(),
end_date=datetime.date.today() + datetime.timedelta(days=1),
)
assert to.is_submitted
class TestCSPEstimate:
def test_setting_estimate_with_attachment(self):
to = TaskOrder()
attachment = Attachment(filename="sample.pdf", object_name="sample")
to.csp_estimate = attachment
assert to.csp_attachment_id == attachment.id
def test_setting_estimate_with_file_storage(self):
to = TaskOrder()
with open(PDF_FILENAME, "rb") as fp:
fs = FileStorage(fp, content_type="application/pdf")
to.csp_estimate = fs
assert to.csp_estimate is not None
assert to.csp_estimate.filename == PDF_FILENAME
def test_setting_estimate_with_invalid_object(self):
to = TaskOrder()
with pytest.raises(TypeError):
to.csp_estimate = "invalid"
def test_setting_estimate_with_empty_value(self):
to = TaskOrder()
assert to.csp_estimate is None
to.csp_estimate = ""
assert to.csp_estimate is None
def test_removing_estimate(self):
attachment = Attachment(filename="sample.pdf", object_name="sample")
to = TaskOrder(csp_estimate=attachment)
assert to.csp_estimate is not None
to.csp_estimate = ""
assert to.csp_estimate is None
class TestPDF:
def test_setting_pdf_with_attachment(self):
to = TaskOrder()