Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
SamDudley committed Mar 25, 2024
1 parent bef7089 commit 77bc8b9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
9 changes: 5 additions & 4 deletions end_of_month/test/test_end_of_month_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,20 +333,21 @@ def test_end_of_month_mar(self):
self.assertEqual(budget_total_count, 12)


# fails
class TestReadArchivedBudgetTest:
@pytest.fixture(autouse=True)
def _setup(self, db):
self.archived_figure = [0 for _ in range(16)]
self.init_data = MonthlyFigureSetup()
self.init_data.setup_budget()
self.post_setup()

def post_setup(self):
pass

def get_period_budget_total(self, period):
data_model = forecast_budget_view_model[period]
tot_q = data_model.objects.filter(financial_year=self.init_data.year_used)
print("period", period)
print("data_model", data_model)
print("year_used", self.init_data.year_used)
print("tot_q", tot_q)
return tot_q[0].budget

def get_current_budget_total(self):
Expand Down
2 changes: 0 additions & 2 deletions end_of_month/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,10 @@ def set_year(self, year):
self.factor = 100000 * (self.year_used - get_current_financial_year() + 1)

def setup_forecast(self):
self.value_dict = {}
self.total_forecast = 0
for period in range(1, 16):
amount = period * self.factor
self.total_forecast += amount
self.value_dict[period] = amount
self.monthly_figure_create(period, amount)

def setup_budget(self):
Expand Down
7 changes: 6 additions & 1 deletion future_years/test/test_end_of_month_archive_budget.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
from django.test import TestCase

from core.utils.generic_helpers import get_current_financial_year
Expand All @@ -7,8 +8,12 @@
from forecast.models import BudgetMonthlyFigure


# fails
class ReadArchivedFutureDataForecast(TestReadArchivedBudgetTest):
def post_setup(self):
@pytest.fixture(autouse=True)
def _setup(self, db):
self.archived_figure = [0 for _ in range(16)]
self.init_data = MonthlyFigureSetup()
current_year = get_current_financial_year()
# Create a set of future budget data
self.init_data.set_year(current_year + 2)
Expand Down

0 comments on commit 77bc8b9

Please sign in to comment.