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 b66c001 commit 75f9f7f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
9 changes: 0 additions & 9 deletions end_of_month/test/test_end_of_month_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ def _setup(self, db):
self.archived_figure = [0 for _ in range(16)]
self.init_data = MonthlyFigureSetup()
self.init_data.setup_forecast()
self.post_setup()

def post_setup(self):
pass

def get_period_total(self, period):
data_model = forecast_budget_view_model[period]
Expand Down Expand Up @@ -333,7 +329,6 @@ def test_end_of_month_mar(self):
self.assertEqual(budget_total_count, 12)


# fails
class TestReadArchivedBudgetTest:
@pytest.fixture(autouse=True)
def _setup(self, db):
Expand All @@ -344,10 +339,6 @@ def _setup(self, db):
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
1 change: 0 additions & 1 deletion future_years/test/test_end_of_month_archive_budget.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from forecast.models import BudgetMonthlyFigure


# fails
class ReadArchivedFutureDataForecast(TestReadArchivedBudgetTest):
@pytest.fixture(autouse=True)
def _setup(self, db):
Expand Down
6 changes: 5 additions & 1 deletion future_years/test/test_end_of_month_archive_forecast.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 @@ -8,7 +9,10 @@


class ReadArchivedFutureDataForecast(TestReadArchivedForecastTest):
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 forecast data
self.init_data.set_year(current_year + 2)
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ test:
docker-compose run --rm web python manage.py test $(test)

pytest:
docker-compose run --rm web pytest --ignore=node_modules --ignore=front_end --ignore=features --ignore=staticfiles --random-order -n 4 -v
docker-compose run --rm web pytest --ignore=node_modules --ignore=front_end --ignore=features --ignore=staticfiles --random-order -n 4

black-check:
docker-compose run --rm --no-deps web black --check .
Expand Down

0 comments on commit 75f9f7f

Please sign in to comment.