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 09ceeee commit 77e63fb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
7 changes: 4 additions & 3 deletions end_of_month/test/test_end_of_month_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_end_of_month_mar(self):
self.assertEqual(count, 129)


class TestReadArchivedForecastTest:
class TestReadArchivedForecast:
@pytest.fixture(autouse=True)
def _setup(self, db):
self.archived_figure = [0 for _ in range(16)]
Expand Down Expand Up @@ -329,7 +329,8 @@ def test_end_of_month_mar(self):
self.assertEqual(budget_total_count, 12)


class TestReadArchivedBudgetTest:
# failed
class TestReadArchivedBudget:
@pytest.fixture(autouse=True)
def _setup(self, db):
self.archived_figure = [0 for _ in range(16)]
Expand Down Expand Up @@ -362,7 +363,7 @@ def check_archive_period(self, tested_period):
# Check the full total. It is saved in a different table, for convenience
monthly_budget = MonthlyTotalBudget.objects.get(archived_period=period)
assert self.archived_figure[period] == monthly_budget.amount
# Check that nothig has corrupted the archived figures
# Check that nothing has corrupted the archived figures
assert self.archived_figure[period] == self.get_period_budget_total(period)

# The following tests check that the archived figures are not changed by
Expand Down
2 changes: 1 addition & 1 deletion end_of_month/test/test_outturn_variance.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from end_of_month.test.test_utils import MonthlyFigureSetup


class TestReadMonthlyVarianceTest:
class TestReadMonthlyVariance:
@pytest.fixture(autouse=True)
def _setup(self, db):
self.archived_figure = [0 for _ in range(16)]
Expand Down
8 changes: 6 additions & 2 deletions future_years/test/test_end_of_month_archive_budget.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@

from core.utils.generic_helpers import get_current_financial_year
from end_of_month.end_of_month_actions import end_of_month_archive
from end_of_month.test.test_end_of_month_process import TestReadArchivedBudgetTest
from end_of_month.test.test_end_of_month_process import (
TestReadArchivedBudget as BaseTestReadArchivedBudget,
)
from end_of_month.test.test_utils import MonthlyFigureSetup
from forecast.models import BudgetMonthlyFigure


class ReadArchivedFutureDataForecast(TestReadArchivedBudgetTest):
# fails
class TestReadArchivedFutureDataForecast(BaseTestReadArchivedBudget):
@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()
current_year = get_current_financial_year()
# Create a set of future budget data
self.init_data.set_year(current_year + 2)
Expand Down
7 changes: 5 additions & 2 deletions future_years/test/test_end_of_month_archive_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@

from core.utils.generic_helpers import get_current_financial_year
from end_of_month.end_of_month_actions import end_of_month_archive
from end_of_month.test.test_end_of_month_process import TestReadArchivedForecastTest
from end_of_month.test.test_end_of_month_process import (
TestReadArchivedForecast as BaseTestReadArchivedForecast,
)
from end_of_month.test.test_utils import MonthlyFigureSetup
from forecast.models import ForecastMonthlyFigure


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

0 comments on commit 77e63fb

Please sign in to comment.