From 706b6c6d7fe40e7cad759ab89f3baf492fd77c6a Mon Sep 17 00:00:00 2001 From: rup Date: Tue, 4 Jul 2023 11:00:28 +0545 Subject: [PATCH] Add models for summary tab --- .../migrations/0001_initial.py | 121 +++++++++++++- apps/assessment_registry/models.py | 156 +++++++++++++++++- .../tests/test_mutation.py | 2 +- .../assessment_registry/tests/test_schemas.py | 2 +- 4 files changed, 263 insertions(+), 18 deletions(-) diff --git a/apps/assessment_registry/migrations/0001_initial.py b/apps/assessment_registry/migrations/0001_initial.py index df292a30cd..ed0a1dfeed 100644 --- a/apps/assessment_registry/migrations/0001_initial.py +++ b/apps/assessment_registry/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.17 on 2023-07-03 05:13 +# Generated by Django 3.2.17 on 2023-07-04 05:35 from django.conf import settings import django.contrib.postgres.fields @@ -12,12 +12,12 @@ class Migration(migrations.Migration): initial = True dependencies = [ + ('geo', '0041_geoarea_centroid'), ('project', '0003_auto_20230508_0608'), - ('organization', '0012_organization_popularity'), + ('lead', '0048_auto_20230228_0810'), ('gallery', '0020_merge_0019_auto_20210120_0443_0019_auto_20210503_0431'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('lead', '0048_auto_20230228_0810'), - ('geo', '0041_geoarea_centroid'), + ('organization', '0012_organization_popularity'), ] operations = [ @@ -47,8 +47,8 @@ class Migration(migrations.Migration): ('data_collection_techniques', models.TextField(blank=True, null=True)), ('sampling', models.TextField(blank=True, null=True)), ('limitations', models.TextField(blank=True, null=True)), - ('focuses', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(blank=True, choices=[(0, 'Context'), (1, 'Shock/Event'), (2, 'Displacement'), (3, 'Humaniterian Access'), (4, 'Information and Communication'), (5, 'Impact (Scope and Scale)'), (6, 'Humanitarian Conditions'), (7, 'Response and Capacities'), (8, 'Current and Forecasted Priorities'), (9, 'Covid 19 Containment Measures')], null=True), size=None)), - ('sectors', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(blank=True, choices=[(0, 'Food'), (1, 'Heath'), (2, 'Shelter'), (3, 'Wash'), (4, 'Protection'), (5, 'Nutrition'), (6, 'Livelihood'), (7, 'Education'), (8, 'Child protection'), (9, 'Gender Based Violence')], null=True), size=None)), + ('focuses', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(blank=True, choices=[(0, 'Context'), (1, 'Shock/Event'), (2, 'Displacement'), (3, 'Casualties'), (4, 'Information and Communication'), (5, 'Humaniterian Access'), (6, 'Impact'), (7, 'Humanitarian Conditions'), (8, 'People at risk'), (9, 'Priorities & Preferences'), (10, 'Response and Capacities')], null=True), size=None)), + ('sectors', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(blank=True, choices=[(0, 'Food Security'), (1, 'Heath'), (2, 'Shelter'), (3, 'Wash'), (4, 'Protection'), (5, 'Nutrition'), (6, 'Livelihood'), (7, 'Education'), (8, 'Logistics'), (9, 'Inter/Cross Sector')], null=True), size=None)), ('protection_info_mgmts', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(blank=True, choices=[(0, 'Protection Monitoring'), (1, 'Protection Needs Assessment'), (2, 'Case Management'), (3, 'Population Data'), (4, 'Protection Response M&E'), (5, 'Communicating with(in) Affected Communities'), (6, 'Security & Situational Awareness'), (7, 'Sectoral System/Other')], null=True), size=None)), ('affected_groups', models.IntegerField(blank=True, choices=[(0, 'All'), (1, 'All/Affected'), (2, 'All/Not Affected'), (3, 'All/Affected/Not Displaced'), (4, 'All/Affected/Displaced'), (5, 'All/Affected/Displaced/In Transit'), (6, 'All/Affected/Displaced/Migrants'), (7, 'All/Affected/Displaced/IDPs'), (8, 'All/Affected/Displced/Asylum Seeker'), (9, 'All/Affected/Displaced/Other of concerns'), (10, 'All/Affected/Displaced/Returnees'), (11, 'All/Affected/Displaced/Refugees'), (12, 'All/Affected/Displaced/Migrants/In transit'), (13, 'All/Affected/Displaced/Migrants/Permanents'), (14, 'All/Affected/Displaced/Migrants/Pendular'), (15, 'All/Affected/Not Displaced/No Host'), (16, 'All/Affected/Not Displaced/Host')], null=True)), ('matrix_score', models.IntegerField(default=0)), @@ -70,6 +70,113 @@ class Migration(migrations.Migration): 'ordering': ['id'], }, ), + migrations.CreateModel( + name='SummaryIssue', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sub_sector', models.IntegerField(blank=True, choices=[(0, 'Politics'), (1, 'Demography'), (2, 'Socio-Cultural'), (3, 'Environment'), (4, 'Security & Stability'), (5, 'Economics'), (6, 'Characteristics'), (7, 'Drivers and Aggravating Factors'), (8, 'Mitigating Factors'), (9, 'Hazards & Threats'), (10, 'Push Factors'), (11, 'Pull Factors'), (12, 'Intentions'), (13, 'Local Integrations'), (14, 'Source & Means'), (15, 'Challanges & Barriers'), (16, 'Knowledge & Info Gaps (Humanitarian)'), (17, 'Knowledge & Info Gaps (Population)'), (18, 'Population To Relief'), (19, 'Relief To Population'), (20, 'Physical & Security')])), + ('focus_sub_sector', models.IntegerField(blank=True, choices=[(0, 'Drivers'), (1, 'Impact on People'), (2, 'Impact On System, Network And Services'), (3, 'Living Standards'), (4, 'Coping Mechanisms'), (5, 'Physical And Mental Well Being'), (6, 'Needs (Population)'), (7, 'Needs (Humanitarian)'), (8, 'Interventions (Population)'), (9, 'Interventions (Humanitarian)'), (10, 'Demographic Groups'), (11, 'Groups With Specific Needs'), (12, 'Geographical Areas'), (13, 'People At Risks'), (14, 'Focal Issues')])), + ('label', models.CharField(max_length=220)), + ('full_label', models.CharField(blank=True, max_length=220)), + ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessment_registry.summaryissue')), + ], + ), + migrations.CreateModel( + name='SummarySubSectorIssue', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('modified_at', models.DateTimeField(auto_now=True)), + ('client_id', models.CharField(blank=True, default=None, max_length=128, null=True, unique=True)), + ('text', models.TextField(blank=True)), + ('order', models.IntegerField(blank=True, null=True)), + ('lead_preview_text_ref', models.JSONField(blank=True, default=None, null=True)), + ('assessment_registry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='summary_sub_sector_issue_ary', to='assessment_registry.assessmentregistry')), + ('created_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summarysubsectorissue_created', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summarysubsectorissue_modified', to=settings.AUTH_USER_MODEL)), + ('summary_issue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='summary_subsector_issue', to='assessment_registry.summaryissue')), + ], + options={ + 'ordering': ['-created_at'], + 'abstract': False, + }, + ), + migrations.CreateModel( + name='SummaryFocusSubSectorIssue', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('modified_at', models.DateTimeField(auto_now=True)), + ('client_id', models.CharField(blank=True, default=None, max_length=128, null=True, unique=True)), + ('focus', models.IntegerField(choices=[(0, 'Food Security'), (1, 'Heath'), (2, 'Shelter'), (3, 'Wash'), (4, 'Protection'), (5, 'Nutrition'), (6, 'Livelihood'), (7, 'Education'), (8, 'Logistics'), (9, 'Inter/Cross Sector')])), + ('text', models.TextField(blank=True)), + ('order', models.IntegerField(blank=True, null=True)), + ('lead_preview_text_ref', models.JSONField(blank=True, default=None, null=True)), + ('assessment_registry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='summary_focus_subsector_issue_ary', to='assessment_registry.assessmentregistry')), + ('created_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summaryfocussubsectorissue_created', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summaryfocussubsectorissue_modified', to=settings.AUTH_USER_MODEL)), + ('summary_issue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='summary_focus_subsector_issue', to='assessment_registry.summaryissue')), + ], + options={ + 'ordering': ['-created_at'], + 'abstract': False, + }, + ), + migrations.CreateModel( + name='SummaryFocus', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('modified_at', models.DateTimeField(auto_now=True)), + ('client_id', models.CharField(blank=True, default=None, max_length=128, null=True, unique=True)), + ('percentage_of_people_affected', models.IntegerField(blank=True, null=True)), + ('total_people_affected', models.IntegerField(blank=True, null=True)), + ('percentage_of_moderate', models.IntegerField(blank=True, null=True)), + ('percentage_of_severe', models.IntegerField(blank=True, null=True)), + ('percentage_of_critical', models.IntegerField(blank=True, null=True)), + ('percentage_in_need', models.IntegerField(blank=True, null=True)), + ('total_moderate', models.IntegerField(blank=True, null=True)), + ('total_severe', models.IntegerField(blank=True, null=True)), + ('total_critical', models.IntegerField(blank=True, null=True)), + ('total_in_need', models.IntegerField(blank=True, null=True)), + ('total_pop_assessed', models.IntegerField(blank=True, null=True)), + ('total_not_affected', models.IntegerField(blank=True, null=True)), + ('total_affected', models.IntegerField(blank=True, null=True)), + ('total_people_in_need', models.IntegerField(blank=True, null=True)), + ('total_people_moderately_in_need', models.IntegerField(blank=True, null=True)), + ('total_people_severly_in_need', models.IntegerField(blank=True, null=True)), + ('total_people_critically_in_need', models.IntegerField(blank=True, null=True)), + ('assessment_registry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='summary_focus', to='assessment_registry.assessmentregistry')), + ('created_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summaryfocus_created', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summaryfocus_modified', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'ordering': ['-created_at'], + 'abstract': False, + }, + ), + migrations.CreateModel( + name='Summary', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('modified_at', models.DateTimeField(auto_now=True)), + ('client_id', models.CharField(blank=True, default=None, max_length=128, null=True, unique=True)), + ('total_people_assessed', models.IntegerField(blank=True, null=True)), + ('total_dead', models.IntegerField(blank=True, null=True)), + ('total_injured', models.IntegerField(blank=True, null=True)), + ('total_missing', models.IntegerField(blank=True, null=True)), + ('total_people_facing_hum_access_cons', models.IntegerField(blank=True, null=True)), + ('percentage_of_people_facing_hum_access_cons', models.IntegerField(blank=True, null=True)), + ('assessment_registry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='summary', to='assessment_registry.assessmentregistry')), + ('created_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summary_created', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summary_modified', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'ordering': ['-created_at'], + 'abstract': False, + }, + ), migrations.CreateModel( name='Question', fields=[ @@ -153,7 +260,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True)), ('modified_at', models.DateTimeField(auto_now=True)), ('client_id', models.CharField(blank=True, default=None, max_length=128, null=True, unique=True)), - ('sector', models.IntegerField(choices=[(0, 'Food'), (1, 'Heath'), (2, 'Shelter'), (3, 'Wash'), (4, 'Protection'), (5, 'Nutrition'), (6, 'Livelihood'), (7, 'Education'), (8, 'Child protection'), (9, 'Gender Based Violence')])), + ('sector', models.IntegerField(choices=[(0, 'Food Security'), (1, 'Heath'), (2, 'Shelter'), (3, 'Wash'), (4, 'Protection'), (5, 'Nutrition'), (6, 'Livelihood'), (7, 'Education'), (8, 'Logistics'), (9, 'Inter/Cross Sector')])), ('value', models.IntegerField(validators=[django.core.validators.MaxValueValidator(49), django.core.validators.MinValueValidator(1)])), ('assessment_registry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='analytical_density', to='assessment_registry.assessmentregistry')), ('created_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='scoreanalyticaldensity_created', to=settings.AUTH_USER_MODEL)), diff --git a/apps/assessment_registry/models.py b/apps/assessment_registry/models.py index 13a9407449..fad7e7de5a 100644 --- a/apps/assessment_registry/models.py +++ b/apps/assessment_registry/models.py @@ -95,16 +95,17 @@ class FocusType(models.IntegerChoices): CONTEXT = 0, 'Context' SHOCK_EVENT = 1, 'Shock/Event' DISPLACEMENT = 2, 'Displacement' - HUMANITERIAN_ACCESS = 3, 'Humaniterian Access' + CASUALTIES = 3, 'Casualties' INFORMATION_AND_COMMUNICATION = 4, 'Information and Communication' - IMPACT = 5, 'Impact (Scope and Scale)' - HUMANITARIAN_CONDITIONS = 6, 'Humanitarian Conditions' - RESPONSE_AND_CAPACITIES = 7, 'Response and Capacities' - CURRENT_AND_FORECASTED_PRIORITIES = 8, 'Current and Forecasted Priorities' - COVID_19_CONTAINMENT_MEASURES = 9, 'Covid 19 Containment Measures' + HUMANITERIAN_ACCESS = 5, 'Humaniterian Access' + IMPACT = 6, 'Impact' + HUMANITARIAN_CONDITIONS = 7, 'Humanitarian Conditions' + PEOPLE_AT_RISK = 8, 'People at risk' + PRIORITIES_AND_PREFERENCES = 9, 'Priorities & Preferences' + RESPONSE_AND_CAPACITIES = 10, 'Response and Capacities' class SectorType(models.IntegerChoices): - FOOD = 0, 'Food' + FOOD_SECURITY = 0, 'Food Security' HEALTH = 1, 'Heath' SHELTER = 2, 'Shelter' WASH = 3, 'Wash' @@ -112,8 +113,8 @@ class SectorType(models.IntegerChoices): NUTRITION = 5, 'Nutrition' LIVELIHOOD = 6, 'Livelihood' EDUCATION = 7, 'Education' - CHILD_PROTECTION = 8, 'Child protection' - GENDER_BASED_VIOLENCE = 9, 'Gender Based Violence' + LOGISTICS = 8, 'Logistics' + INTER_CROSS_SECTOR = 9, 'Inter/Cross Sector' class ProtectionInfoType(models.IntegerChoices): PROTECTION_MONITORING = 0, 'Protection Monitoring' @@ -430,3 +431,140 @@ class Answer(UserResource): class Meta: ordering = ["id"] unique_together = [["assessment_registry", "question"]] + + +class Summary(UserResource): + class Sector(models.IntegerChoices): + CONTEXT = 0, 'Context' + EVENT_SHOCK = 1, 'Event/Shock' + DISPLACEMENT = 2, 'Displacement' + INFORMATION_AND_COMMUNICATION = 3, 'Information & Communication' + HUMANITARIAN_ACCESS = 4, 'Humanitarian Access' + + assessment_registry = models.ForeignKey( + AssessmentRegistry, + on_delete=models.CASCADE, + related_name='summary' + ) + total_people_assessed = models.IntegerField(null=True, blank=True) + total_dead = models.IntegerField(null=True, blank=True) + total_injured = models.IntegerField(null=True, blank=True) + total_missing = models.IntegerField(null=True, blank=True) + total_people_facing_hum_access_cons = models.IntegerField(null=True, blank=True) + percentage_of_people_facing_hum_access_cons = models.IntegerField(null=True, blank=True) + + +class SummarySubSectorIssue(UserResource): + assessment_registry = models.ForeignKey( + AssessmentRegistry, + on_delete=models.CASCADE, + related_name='summary_sub_sector_issue_ary' + ) + summary_issue = models.ForeignKey( + 'SummaryIssue', + on_delete=models.CASCADE, + related_name='summary_subsector_issue' + ) + text = models.TextField(blank=True) + order = models.IntegerField(blank=True, null=True) + lead_preview_text_ref = models.JSONField(default=None, blank=True, null=True) + + +class SummaryFocus(UserResource): + class Sector(models.IntegerChoices): + IMPACT = 0, 'Impact' + HUMANITARIAN_CONDITIONS = 1, 'Humanitarian Conditions' + PRIORITIES_AND_PREFERENCES = 2, 'Priorities & Preferences' + CONCLUSIONS = 3, 'Conclusions' + HUMANITARIAN_POPULATION_FIGURES = 4, 'Humanitarian Population Figures' + + assessment_registry = models.ForeignKey( + AssessmentRegistry, + on_delete=models.CASCADE, + related_name='summary_focus' + ) + percentage_of_people_affected = models.IntegerField(null=True, blank=True) + total_people_affected = models.IntegerField(null=True, blank=True) + percentage_of_moderate = models.IntegerField(null=True, blank=True) + percentage_of_severe = models.IntegerField(null=True, blank=True) + percentage_of_critical = models.IntegerField(null=True, blank=True) + percentage_in_need = models.IntegerField(null=True, blank=True) + total_moderate = models.IntegerField(null=True, blank=True) + total_severe = models.IntegerField(null=True, blank=True) + total_critical = models.IntegerField(null=True, blank=True) + total_in_need = models.IntegerField(null=True, blank=True) + total_pop_assessed = models.IntegerField(null=True, blank=True) + total_not_affected = models.IntegerField(null=True, blank=True) + total_affected = models.IntegerField(null=True, blank=True) + total_people_in_need = models.IntegerField(null=True, blank=True) + total_people_moderately_in_need = models.IntegerField(null=True, blank=True) + total_people_severly_in_need = models.IntegerField(null=True, blank=True) + total_people_critically_in_need = models.IntegerField(null=True, blank=True) + + +class SummaryIssue(models.Model): + class SubSector(models.IntegerChoices): + POLITICS = 0, 'Politics' + DEMOGRAPHY = 1, 'Demography' + SOCIO_CULTURAL = 2, 'Socio-Cultural' + ENVIRONMENT = 3, 'Environment' + SECURITY_AND_STABILITY = 4, 'Security & Stability' + ECONOMICS = 5, 'Economics' + CHARACTERISTICS = 6, 'Characteristics' + DRIVERS_AND_AGGRAVATING_FACTORS = 7, 'Drivers and Aggravating Factors' + MITIGATING_FACTORS = 8, 'Mitigating Factors' + HAZARDS_AND_THREATS = 9, 'Hazards & Threats' + PUSH_FACTORS = 10, 'Push Factors' + PULL_FACTORS = 11, 'Pull Factors' + INTENTIONS = 12, 'Intentions' + LOCAL_INTREGATIONS = 13, 'Local Integrations' + SOURCE_AND_MEANS = 14, 'Source & Means' + CHALLANGES_AND_BARRIERS = 15, 'Challanges & Barriers' + KNOWLEDGE_AND_INFO_GAPS_HUMAN = 16, 'Knowledge & Info Gaps (Humanitarian)' + KNOWLEDGE_AND_INFO_GAPS_POP = 17, 'Knowledge & Info Gaps (Population)' + POPULATION_TO_RELIEF = 18, 'Population To Relief' + RELIEF_TO_POPULATION = 19, 'Relief To Population' + PHYSICAL_AND_SECURITY = 20, 'Physical & Security' + + class FocusSubSector(models.IntegerChoices): + DRIVERS = 0, 'Drivers' + IMPACT_ON_PEOPLE = 1, 'Impact on People' + IMPACT_ON_SYSTEM = 2, 'Impact On System, Network And Services' + LIVING_STANDARDS = 3, 'Living Standards' + COPING_MECHANISMS = 4, 'Coping Mechanisms' + PHYSICAL_AND_MENTAL_WELL_BEING = 5, 'Physical And Mental Well Being' + NEEDS_POP = 6, 'Needs (Population)' + NEEDS_HUMAN = 7, 'Needs (Humanitarian)' + INTERVENTIONS_POP = 8, 'Interventions (Population)' + INTERVENTIONS_HUMAN = 9, 'Interventions (Humanitarian)' + DEMOGRAPHIC_GROUPS = 10, 'Demographic Groups' + GROUPS_WITH_SPECIFIC_NEEDS = 11, 'Groups With Specific Needs' + GEOGRAPHICAL_AREAS = 12, 'Geographical Areas' + PEOPLE_AT_RISKS = 13, 'People At Risks' + FOCAL_ISSUES = 14, 'Focal Issues' + + sub_sector = models.IntegerField(choices=SubSector.choices, blank=True) + focus_sub_sector = models.IntegerField(choices=FocusSubSector.choices, blank=True) + parent = models.ForeignKey( + 'SummaryIssue', + on_delete=models.CASCADE, + ) + label = models.CharField(max_length=220) + full_label = models.CharField(max_length=220, blank=True) + + +class SummaryFocusSubSectorIssue(UserResource): + assessment_registry = models.ForeignKey( + AssessmentRegistry, + on_delete=models.CASCADE, + related_name='summary_focus_subsector_issue_ary' + ) + focus = models.IntegerField(choices=AssessmentRegistry.SectorType.choices) + summary_issue = models.ForeignKey( + SummaryIssue, + on_delete=models.CASCADE, + related_name='summary_focus_subsector_issue' + ) + text = models.TextField(blank=True) + order = models.IntegerField(blank=True, null=True) + lead_preview_text_ref = models.JSONField(default=None, blank=True, null=True) diff --git a/apps/assessment_registry/tests/test_mutation.py b/apps/assessment_registry/tests/test_mutation.py index 5723557c7b..799562a581 100644 --- a/apps/assessment_registry/tests/test_mutation.py +++ b/apps/assessment_registry/tests/test_mutation.py @@ -196,7 +196,7 @@ def _query_check(minput, **kwargs): ], scoreAnalyticalDensity=[ dict( - sector=self.genum(AssessmentRegistry.SectorType.FOOD), + sector=self.genum(AssessmentRegistry.SectorType.FOOD_SECURITY), value=10 ), dict( diff --git a/apps/assessment_registry/tests/test_schemas.py b/apps/assessment_registry/tests/test_schemas.py index 481c2437d3..f200f734a7 100644 --- a/apps/assessment_registry/tests/test_schemas.py +++ b/apps/assessment_registry/tests/test_schemas.py @@ -157,7 +157,7 @@ def test_assessment_registry_query(self): # Add Score Analytical Density ScoreAnalyticalDensityFactory.create( assessment_registry=assessment_registry, - sector=AssessmentRegistry.SectorType.FOOD, + sector=AssessmentRegistry.SectorType.FOOD_SECURITY, value=1 ) ScoreAnalyticalDensityFactory.create(