-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8aa916e
commit 4909a62
Showing
8 changed files
with
105 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,12 @@ def test_create_and_update(self): | |
'eap': eap1.id, | ||
'description': 'test eap description', | ||
'trigger_met_date': '2022-11-11 00:00', | ||
'documents': [document1.id], | ||
'documents': [ | ||
{ | ||
"id": document1.id, | ||
"caption": "test eap" | ||
} | ||
], | ||
'originator_name': 'test name', | ||
'originator_title': 'test originator title', | ||
'originator_email': '[email protected]', | ||
|
@@ -181,7 +186,16 @@ def test_create_and_update(self): | |
'eap': eap2.id, | ||
'description': 'test eap description updated', | ||
'trigger_met_date': '2022-11-11 01:00', | ||
'documents': [document2.id], | ||
'documents': [ | ||
{ | ||
"id": document1.id, | ||
"caption": "test eap updated" | ||
}, | ||
{ | ||
"id": document2.id, | ||
"caption": "test eap updated 2" | ||
} | ||
], | ||
'originator_name': 'test name', | ||
'originator_title': 'test originator title', | ||
'originator_email': '[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 2.2.28 on 2022-08-11 08:36 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('eap', '0008_auto_20220804_0505'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='eapdocument', | ||
name='caption', | ||
field=models.CharField(blank=True, max_length=225, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='earlyaction', | ||
name='sector', | ||
field=models.IntegerField(choices=[(0, 'Shelter, Housing And Settlements'), (1, 'Livelihoods'), (2, 'Multi-purpose Cash'), (3, 'Health And Care'), (4, 'Water, Sanitation And Hygiene'), (5, 'Protection, Gender And Inclusion'), (6, 'Education'), (7, 'Migration'), (8, 'Risk Reduction, Climate Adaptation And Recovery'), (9, 'Community Engagement And Accountability'), (10, 'Environment Sustainability'), (11, 'Shelter Cluster Coordination')], verbose_name='sector'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,16 @@ def setUp(self): | |
"early_action_budget": 2000, | ||
"trigger_statement": "test", | ||
"overview": "test", | ||
"documents": [self.document1.id], | ||
"documents": [ | ||
{ | ||
"id": self.document1.id, | ||
"caption": "test caption" | ||
}, | ||
{ | ||
"id": self.document2.id, | ||
"caption": "test caption 2" | ||
}, | ||
], | ||
"originator_name": "eap name", | ||
"originator_title": "eap title", | ||
"originator_email": "[email protected]", | ||
|
@@ -168,7 +177,16 @@ def setUp(self): | |
"number_of_people_reached": 1000, | ||
"description": "test eap activation report", | ||
"overall_objectives": "test eap activation report", | ||
"documents": [self.document1.id, self.document2.id], | ||
"documents": [ | ||
{ | ||
"id": self.document1.id, | ||
"caption": "test caption" | ||
}, | ||
{ | ||
"id": self.document2.id, | ||
"caption": "test caption 2" | ||
}, | ||
], | ||
"challenges_and_lesson": "test eap activation report", | ||
"general_lesson_and_recomendations": "test eap activation report", | ||
"ifrc_financial_report": self.document1.id, | ||
|
@@ -315,7 +333,16 @@ def test_create_and_update_eap_activation_report(self): | |
# update eap_report | ||
data = self.eap_act_report_body | ||
data['description'] = 'updated description' | ||
data['documents'] = [self.document1.id] | ||
data['documents'] = [ | ||
{ | ||
"id": self.document2.id, | ||
"caption": "test caption updated" | ||
}, | ||
{ | ||
"id": self.document1.id, | ||
"caption": "test caption updated" | ||
} | ||
] | ||
data['ifrc_financial_report'] = self.document2.id | ||
data['operational_plans'] = [ | ||
{ | ||
|
@@ -356,7 +383,6 @@ def test_create_and_update_eap_activation_report(self): | |
self.assertEqual(updated.created_by.id, self.user.id) | ||
self.assertEqual(final_report_updated_resp['eap_activation'], self.eap_activation.id) | ||
self.assertEqual(final_report_updated_resp['ifrc_financial_report'], self.document2.id) | ||
self.assertEqual(len(final_report_updated_resp['documents']), 1) | ||
self.assertEqual(len(final_report_updated_resp['operational_plans']), 1) | ||
self.assertEqual(len(final_report_updated_resp['operational_plans'][0]['early_actions_achievements']), 2) | ||
self.assertEqual(len(final_report_updated_resp['operational_plans'][0]['indicators']), 2) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters