Remove request-related models

This commit is contained in:
Patrick Smith
2019-02-20 15:57:30 -05:00
parent 6fb333acb9
commit 2c62f54b83
19 changed files with 42 additions and 745 deletions

View File

@@ -1,27 +1,17 @@
from atst.domain.reports import Reports
from tests.factories import RequestFactory, LegacyTaskOrderFactory, PortfolioFactory
CLIN_NUMS = ["0001", "0003", "1001", "1003", "2001", "2003"]
from tests.factories import PortfolioFactory
def test_portfolio_totals():
legacy_task_order = LegacyTaskOrderFactory.create()
for num in CLIN_NUMS:
setattr(legacy_task_order, "clin_{}".format(num), 200)
request = RequestFactory.create(legacy_task_order=legacy_task_order)
portfolio = PortfolioFactory.create(request=request)
portfolio = PortfolioFactory.create()
report = Reports.portfolio_totals(portfolio)
total = 200 * len(CLIN_NUMS)
assert report == {"budget": total, "spent": 0}
assert report == {"budget": 0, "spent": 0}
# this is sketched in until we do real reporting
def test_monthly_totals():
request = RequestFactory.create()
portfolio = PortfolioFactory.create(request=request)
portfolio = PortfolioFactory.create()
monthly = Reports.monthly_totals(portfolio)
assert not monthly["environments"]
@@ -31,8 +21,7 @@ def test_monthly_totals():
# this is sketched in until we do real reporting
def test_cumulative_budget():
request = RequestFactory.create()
portfolio = PortfolioFactory.create(request=request)
portfolio = PortfolioFactory.create()
months = Reports.cumulative_budget(portfolio)
assert len(months["months"]) >= 12