From 77bc8b98de74623041a96f192060e29039169b17 Mon Sep 17 00:00:00 2001 From: Sam Dudley Date: Mon, 25 Mar 2024 09:13:30 +0000 Subject: [PATCH] wip --- end_of_month/test/test_end_of_month_process.py | 9 +++++---- end_of_month/test/test_utils.py | 2 -- future_years/test/test_end_of_month_archive_budget.py | 7 ++++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/end_of_month/test/test_end_of_month_process.py b/end_of_month/test/test_end_of_month_process.py index ebd5fc46..9d903fdc 100644 --- a/end_of_month/test/test_end_of_month_process.py +++ b/end_of_month/test/test_end_of_month_process.py @@ -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): diff --git a/end_of_month/test/test_utils.py b/end_of_month/test/test_utils.py index 0c11d033..4b41966d 100644 --- a/end_of_month/test/test_utils.py +++ b/end_of_month/test/test_utils.py @@ -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): diff --git a/future_years/test/test_end_of_month_archive_budget.py b/future_years/test/test_end_of_month_archive_budget.py index c5381b3f..ea646f65 100644 --- a/future_years/test/test_end_of_month_archive_budget.py +++ b/future_years/test/test_end_of_month_archive_budget.py @@ -1,3 +1,4 @@ +import pytest from django.test import TestCase from core.utils.generic_helpers import get_current_financial_year @@ -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)