Skip to content

Commit

Permalink
FFT-50 Improve local env test data and DX
Browse files Browse the repository at this point in the history
  • Loading branch information
SamDudley committed Oct 2, 2024
1 parent 31e8d4d commit 6f62327
Show file tree
Hide file tree
Showing 23 changed files with 1,398 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ALLOWED_HOSTS="*"
DEBUG=True
DISABLE_COLLECTSTATIC="0"
DATABASE_URL=psql://postgres:postgres@db:5432/fido
REDIS_ENDPOINT=redis://redis:6379
CACHE_ENDPOINT=redis://redis:6379

# Authbroker
AUTHBROKER_CLIENT_ID=copy-from-dev-environment
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ jobs:
run: make black-check

- name: Run tests
run: make pytest
run: make test-ci

- name: Bring up chrome
run: docker compose up -d chrome

- name: Run makemigrations in check mode
run: make check-migrations

- name: Run BDD tests
run: make bdd

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,321 @@
# Generated by Django 4.2.15 on 2024-10-02 12:37

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("chartofaccountDIT", "0014_alter_archivedanalysis1_financial_year_and_more"),
]

operations = [
migrations.AlterModelOptions(
name="simplehistoryanalysis1",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Contract Reconciliation (Analysis 1)",
"verbose_name_plural": "historical Contract Reconciliations (Analysis 1)",
},
),
migrations.AlterModelOptions(
name="simplehistoryanalysis2",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Market (Analysis 2)",
"verbose_name_plural": "historical Markets (Analysis 2)",
},
),
migrations.AlterModelOptions(
name="simplehistoryarchivedanalysis1",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Archived Contract Reconciliation (Analysis 1)",
"verbose_name_plural": "historical Archived Contract Reconciliations (Analysis 1)",
},
),
migrations.AlterModelOptions(
name="simplehistoryarchivedanalysis2",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Archived Market (Analysis 2)",
"verbose_name_plural": "historical Archived Markets (Analysis 2)",
},
),
migrations.AlterModelOptions(
name="simplehistoryarchivedcommercialcategory",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Archived Commercial Category",
"verbose_name_plural": "historical Archived Commercial Categories",
},
),
migrations.AlterModelOptions(
name="simplehistoryarchivedexpenditurecategory",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Archived Budget Category",
"verbose_name_plural": "historical Archived Budget Categories",
},
),
migrations.AlterModelOptions(
name="simplehistoryarchivedfcomapping",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Archived FCO Mapping",
"verbose_name_plural": "historical Archived FCO Mappings",
},
),
migrations.AlterModelOptions(
name="simplehistoryarchivedinterentity",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Archived Inter-Entity",
"verbose_name_plural": "historical Archived Inter-Entities",
},
),
migrations.AlterModelOptions(
name="simplehistoryarchivednaturalcode",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Archived Natural Account Code (NAC)",
"verbose_name_plural": "historical Archived Natural Account Codes (NAC)",
},
),
migrations.AlterModelOptions(
name="simplehistoryarchivedprogrammecode",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Archived Programme Code",
"verbose_name_plural": "historical Archived Programme Codes",
},
),
migrations.AlterModelOptions(
name="simplehistoryarchivedprojectcode",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Archived Project",
"verbose_name_plural": "historical Archived Projects",
},
),
migrations.AlterModelOptions(
name="simplehistorybudgettype",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical budget type",
"verbose_name_plural": "historical budget types",
},
),
migrations.AlterModelOptions(
name="simplehistorycommercialcategory",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Commercial Category",
"verbose_name_plural": "historical Commercial Categories",
},
),
migrations.AlterModelOptions(
name="simplehistoryexpenditurecategory",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Budget Category",
"verbose_name_plural": "historical Budget Categories",
},
),
migrations.AlterModelOptions(
name="simplehistoryfcomapping",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical FCO Mapping",
"verbose_name_plural": "historical FCO Mappings",
},
),
migrations.AlterModelOptions(
name="simplehistoryinterentity",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Inter-Entity",
"verbose_name_plural": "historical Inter-Entities",
},
),
migrations.AlterModelOptions(
name="simplehistoryinterentityl1",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Government Body",
"verbose_name_plural": "historical Government Bodies",
},
),
migrations.AlterModelOptions(
name="simplehistorynaccategory",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Budget Grouping",
"verbose_name_plural": "historical Budget Groupings",
},
),
migrations.AlterModelOptions(
name="simplehistorynaturalcode",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Natural Account Code (NAC)",
"verbose_name_plural": "historical Natural Account Codes (NAC)",
},
),
migrations.AlterModelOptions(
name="simplehistoryoperatingdeliverycategory",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Operating Delivery Plan Category",
"verbose_name_plural": "historical Operating Delivery Plan Categories",
},
),
migrations.AlterModelOptions(
name="simplehistoryprogrammecode",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Programme Code",
"verbose_name_plural": "historical Programme Codes",
},
),
migrations.AlterModelOptions(
name="simplehistoryprojectcode",
options={
"get_latest_by": ("history_date", "history_id"),
"ordering": ("-history_date", "-history_id"),
"verbose_name": "historical Project",
"verbose_name_plural": "historical Projects",
},
),
migrations.AlterField(
model_name="simplehistoryanalysis1",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryanalysis2",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryarchivedanalysis1",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryarchivedanalysis2",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryarchivedcommercialcategory",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryarchivedexpenditurecategory",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryarchivedfcomapping",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryarchivedinterentity",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryarchivednaturalcode",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryarchivedprogrammecode",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryarchivedprojectcode",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistorybudgettype",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistorycommercialcategory",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryexpenditurecategory",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryfcomapping",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryinterentity",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryinterentityl1",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistorynaccategory",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistorynaturalcode",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryoperatingdeliverycategory",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryprogrammecode",
name="history_date",
field=models.DateTimeField(db_index=True),
),
migrations.AlterField(
model_name="simplehistoryprojectcode",
name="history_date",
field=models.DateTimeField(db_index=True),
),
]
2 changes: 2 additions & 0 deletions config/settings/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
]

ASYNC_FILE_UPLOAD = False

AXES_ENABLED = False
2 changes: 2 additions & 0 deletions config/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
]

ASYNC_FILE_UPLOAD = False

AXES_ENABLED = False
1 change: 1 addition & 0 deletions core/management/commands/create_stub_forecast_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def create_monthly_figures():
)
budget_amount += 1

# archive the first 2 months (apr, may)
for period_id in range(1, 3):
end_of_month_archive(period_id)
actual = FinancialPeriod.objects.get(financial_period_code=period_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def handle(self, *args, **options):
action = create_future_year_figure
msg = "created"

# if 2020 is the current financial year then this will be 2021, 2022, 2023
for interval in range(1, 4):
year_obj = get_financial_year_obj(financial_year + interval)

Expand Down
Loading

0 comments on commit 6f62327

Please sign in to comment.