Delete unneeded tests
This commit is contained in:
parent
de7097e55b
commit
c1383e1ec7
@ -75,45 +75,6 @@ def test_task_order_sorting():
|
|||||||
assert TaskOrders.sort(task_orders) == task_orders
|
assert TaskOrders.sort(task_orders) == task_orders
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="Need to reimplement after new TO form is created")
|
|
||||||
def test_section_completion_status():
|
|
||||||
dict_keys = [k for k in TaskOrders.SECTIONS.keys()]
|
|
||||||
section = dict_keys[0]
|
|
||||||
attrs = TaskOrders.SECTIONS[section].copy()
|
|
||||||
attrs.remove("portfolio_name")
|
|
||||||
task_order = TaskOrderFactory.create(**{k: None for k in attrs})
|
|
||||||
leftover = attrs.pop()
|
|
||||||
|
|
||||||
for attr in attrs:
|
|
||||||
setattr(task_order, attr, "str12345")
|
|
||||||
assert TaskOrders.section_completion_status(task_order, section) == "draft"
|
|
||||||
|
|
||||||
setattr(task_order, leftover, "str12345")
|
|
||||||
assert TaskOrders.section_completion_status(task_order, section) == "complete"
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="Need to reimplement after new TO form is created")
|
|
||||||
def test_all_sections_complete():
|
|
||||||
task_order = TaskOrderFactory.create()
|
|
||||||
attachment = Attachment(
|
|
||||||
filename="sample_attachment",
|
|
||||||
object_name="sample",
|
|
||||||
resource="task_order",
|
|
||||||
resource_id=task_order.id,
|
|
||||||
)
|
|
||||||
|
|
||||||
custom_attrs = {"csp_estimate": attachment}
|
|
||||||
for attr_list in TaskOrders.SECTIONS.values():
|
|
||||||
for attr in attr_list:
|
|
||||||
if not getattr(task_order, attr):
|
|
||||||
setattr(task_order, attr, custom_attrs.get(attr, "str12345"))
|
|
||||||
|
|
||||||
task_order.scope = None
|
|
||||||
assert not TaskOrders.all_sections_complete(task_order)
|
|
||||||
task_order.scope = "str12345"
|
|
||||||
assert TaskOrders.all_sections_complete(task_order)
|
|
||||||
|
|
||||||
|
|
||||||
def test_create_adds_clins(pdf_upload):
|
def test_create_adds_clins(pdf_upload):
|
||||||
portfolio = PortfolioFactory.create()
|
portfolio = PortfolioFactory.create()
|
||||||
clins = [
|
clins = [
|
||||||
|
@ -78,61 +78,3 @@ def test_submit_task_order(client, user_session, task_order):
|
|||||||
url_for("task_orders.submit_task_order", task_order_id=upcoming_task_order.id)
|
url_for("task_orders.submit_task_order", task_order_id=upcoming_task_order.id)
|
||||||
)
|
)
|
||||||
assert upcoming_task_order.status == TaskOrderStatus.UPCOMING
|
assert upcoming_task_order.status == TaskOrderStatus.UPCOMING
|
||||||
|
|
||||||
|
|
||||||
class TestPortfolioFunding:
|
|
||||||
@pytest.mark.skip(reason="Update later when CLINs are implemented")
|
|
||||||
def test_funded_portfolio(self, app, user_session, portfolio):
|
|
||||||
user_session(portfolio.owner)
|
|
||||||
|
|
||||||
pending_to = TaskOrderFactory.create(portfolio=portfolio)
|
|
||||||
active_to1 = TaskOrderFactory.create(portfolio=portfolio, number="42")
|
|
||||||
active_to2 = TaskOrderFactory.create(portfolio=portfolio, number="43")
|
|
||||||
end_date = (
|
|
||||||
active_to1.end_date
|
|
||||||
if active_to1.end_date > active_to2.end_date
|
|
||||||
else active_to2.end_date
|
|
||||||
)
|
|
||||||
|
|
||||||
with captured_templates(app) as templates:
|
|
||||||
response = app.test_client().get(
|
|
||||||
url_for("task_orders.portfolio_funding", portfolio_id=portfolio.id)
|
|
||||||
)
|
|
||||||
|
|
||||||
assert response.status_code == 200
|
|
||||||
_, context = templates[0]
|
|
||||||
assert context["funding_end_date"] is end_date
|
|
||||||
assert context["total_balance"] == active_to1.budget + active_to2.budget
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="Update later when CLINs are implemented")
|
|
||||||
def test_expiring_and_funded_portfolio(self, app, user_session, portfolio):
|
|
||||||
user_session(portfolio.owner)
|
|
||||||
|
|
||||||
expiring_to = TaskOrderFactory.create(portfolio=portfolio, number="42")
|
|
||||||
active_to = TaskOrderFactory.create(portfolio=portfolio, number="43")
|
|
||||||
|
|
||||||
with captured_templates(app) as templates:
|
|
||||||
response = app.test_client().get(
|
|
||||||
url_for("task_orders.portfolio_funding", portfolio_id=portfolio.id)
|
|
||||||
)
|
|
||||||
|
|
||||||
assert response.status_code == 200
|
|
||||||
_, context = templates[0]
|
|
||||||
assert context["funding_end_date"] is active_to.end_date
|
|
||||||
assert context["funded"] == True
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="Update later when CLINs are implemented")
|
|
||||||
def test_expiring_and_unfunded_portfolio(self, app, user_session, portfolio):
|
|
||||||
user_session(portfolio.owner)
|
|
||||||
|
|
||||||
expiring_to = TaskOrderFactory.create(portfolio=portfolio, number="42")
|
|
||||||
|
|
||||||
with captured_templates(app) as templates:
|
|
||||||
response = app.test_client().get(
|
|
||||||
url_for("task_orders.portfolio_funding", portfolio_id=portfolio.id)
|
|
||||||
)
|
|
||||||
|
|
||||||
assert response.status_code == 200
|
|
||||||
_, context = templates[0]
|
|
||||||
assert context["funding_end_date"] is expiring_to.end_date
|
|
||||||
assert context["funded"] == False
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user