Unit test analysis

* adds unit test for creating report
* fixes bug where new (>2018) eco accounts have not been fetched correctly from the  db
* adds enhancements in the frontend
* improves test data setup
This commit is contained in:
2023-08-17 10:12:05 +02:00
parent 865a3a51fe
commit 1726eb38ad
15 changed files with 211 additions and 32 deletions

View File

@@ -413,6 +413,7 @@ class TimespanReport:
def __init__(self, id: str, date_from: str, date_to: str):
# First fetch all eco account for this office
self.queryset = EcoAccount.objects.filter(
legal__registration_date__gt=LKOMPVZVO_PUBLISH_DATE,
responsible__conservation_office__id=id,
deleted=None,
created__timestamp__date__gte=date_from,
@@ -516,8 +517,8 @@ class TimespanReport:
legal__registration_date__lte=LKOMPVZVO_PUBLISH_DATE,
responsible__conservation_office__id=id,
deleted=None,
created__timestamp__gte=date_from,
created__timestamp__lte=date_to,
created__timestamp__date__gte=date_from,
created__timestamp__date__lte=date_to,
)
self.queryset_acc_recorded = self.queryset_acc.filter(
recorded__isnull=False,