From 48b56e2f8a244f6eff8e972a617ac9c10a8af8ae Mon Sep 17 00:00:00 2001 From: sudan45 Date: Tue, 26 Mar 2024 14:01:00 +0545 Subject: [PATCH] Update assessment-dashboard filter field from created_at to publication_date --- apps/assessment_registry/tests/test_dashboard_schema.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/assessment_registry/tests/test_dashboard_schema.py b/apps/assessment_registry/tests/test_dashboard_schema.py index 82334c1f85..86f9bda6e5 100644 --- a/apps/assessment_registry/tests/test_dashboard_schema.py +++ b/apps/assessment_registry/tests/test_dashboard_schema.py @@ -1,4 +1,4 @@ -from datetime import date, timedelta +from datetime import date from utils.graphene.tests import GraphQLTestCase @@ -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], @@ -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"] @@ -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'],