commit
0dccef9bb7
@ -183,7 +183,7 @@ class MockReportingProvider(ReportingInterface):
|
|||||||
"Beluga": {
|
"Beluga": {
|
||||||
"cumulative": CUMULATIVE_BUDGET_BELUGA,
|
"cumulative": CUMULATIVE_BUDGET_BELUGA,
|
||||||
"applications": [
|
"applications": [
|
||||||
MockApplication("NP02", ["Integ", "PreProd", "NP02_Prod"]),
|
MockApplication("NP02", ["Integ", "PreProd", "Prod"]),
|
||||||
MockApplication("FM", ["Integ", "Prod"]),
|
MockApplication("FM", ["Integ", "Prod"]),
|
||||||
],
|
],
|
||||||
"budget": 70000,
|
"budget": 70000,
|
||||||
@ -296,10 +296,13 @@ class MockReportingProvider(ReportingInterface):
|
|||||||
else:
|
else:
|
||||||
budget_months = {}
|
budget_months = {}
|
||||||
|
|
||||||
this_year = pendulum.now().year
|
end = pendulum.now()
|
||||||
|
start = end.subtract(months=12)
|
||||||
|
period = pendulum.period(start, end)
|
||||||
|
|
||||||
all_months = OrderedDict()
|
all_months = OrderedDict()
|
||||||
for m in range(1, 13):
|
for t in period.range("months"):
|
||||||
month_str = "{month:02d}/{year}".format(month=m, year=this_year)
|
month_str = "{month:02d}/{year}".format(month=t.month, year=t.year)
|
||||||
all_months[month_str] = budget_months.get(month_str, None)
|
all_months[month_str] = budget_months.get(month_str, None)
|
||||||
|
|
||||||
return {"months": all_months}
|
return {"months": all_months}
|
||||||
|
@ -35,4 +35,4 @@ def test_cumulative_budget():
|
|||||||
portfolio = PortfolioFactory.create(request=request)
|
portfolio = PortfolioFactory.create(request=request)
|
||||||
months = Reports.cumulative_budget(portfolio)
|
months = Reports.cumulative_budget(portfolio)
|
||||||
|
|
||||||
assert len(months["months"]) == 12
|
assert len(months["months"]) >= 12
|
||||||
|
Loading…
x
Reference in New Issue
Block a user