Skip to content

Commit

Permalink
Update assessment-dashboard filter field from created_at to publicati…
Browse files Browse the repository at this point in the history
…on_date
  • Loading branch information
sudan45 committed May 2, 2024
1 parent cb0913a commit 48b56e2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions apps/assessment_registry/tests/test_dashboard_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import date, timedelta
from datetime import date

from utils.graphene.tests import GraphQLTestCase

Expand Down Expand Up @@ -185,7 +185,7 @@ def _query_check(minput, **kwargs):
limitations="test",
objectives="test",
noOfPages=10,
publicationDate=str(date.today()),
publicationDate='2023-01-01',
sampling="test",
language=[self.genum(AssessmentRegistry.Language.ENGLISH), self.genum(AssessmentRegistry.Language.SPANISH)],
bgCountries=[self.region.id],
Expand Down Expand Up @@ -333,7 +333,7 @@ def test_assessment_registry_dashboard_stats(self):
def _query_check(filter=None, **kwargs):
return self.query_check(query, variables={"filter": filter, "id": self.project1.id}, **kwargs)

filter = {"dateFrom": "2019-01-01", "dateTo": str(date.today() + timedelta(1))}
filter = {"dateFrom": "2019-01-01", "dateTo": "2023-01-01"}

self.force_login(self.member_user)
content = _query_check(filter)["data"]["project"]["assessmentDashboardStatistics"]
Expand All @@ -352,8 +352,7 @@ def _query_check(filter=None, **kwargs):
self.assertEqual(content["assessmentGeographicAreas"][0]["geoArea"], str(self.geo_area1.id))
self.assertEqual(content["assessmentGeographicAreas"][1]["geoArea"], str(self.geo_area2.id))
self.assertEqual(content["assessmentByOverTime"][0]["count"], 1)
self.assertEqual(content["assessmentByOverTime"][0]["date"], str(date.today()))
self.assertEqual(content["assessmentPerFrameworkPillar"][0]["date"], str(date.today()))
self.assertEqual(content["assessmentPerFrameworkPillar"][0]["date"], "2023-01-01")
# assessment dashboard tab 2
self.assertEqual(
content['assessmentByDataCollectionTechniqueAndGeolocation'][0]['dataCollectionTechnique'],
Expand Down

0 comments on commit 48b56e2

Please sign in to comment.