Browse Source

Add test for Children: What are you asking for?

pull/170/head
ariannedee 5 years ago
parent
commit
636894721e
2 changed files with 47 additions and 0 deletions
  1. +45
    -0
      edivorce/apps/core/tests/test_step_completeness.py
  2. +2
    -0
      edivorce/apps/core/utils/question_step_mapping.py

+ 45
- 0
edivorce/apps/core/tests/test_step_completeness.py View File

@ -371,6 +371,9 @@ class ChildrenStepCompletenessTestCase(TestCase):
response.value = value
response.save()
def delete_response(self, questions):
UserResponse.objects.filter(bceid_user=self.user, question_id__in=questions).update(value='')
def test_children_details(self):
substep = 'your_children'
@ -441,3 +444,45 @@ class ChildrenStepCompletenessTestCase(TestCase):
self.assertFalse(self.is_step_complete(substep))
self.create_response('whose_plan_is_coverage_under', '["My plan","Spouse"]')
self.assertTrue(self.is_step_complete(substep))
def test_what_are_you_asking_for(self):
substep = 'what_for'
self.assertFalse(self.is_step_complete(substep))
self.assertEqual(self.get_children_step_status(substep), 'Not started')
# All basic required fields
self.create_response('child_support_in_order', 'MATCH')
self.create_response('have_separation_agreement', 'NO')
self.create_response('have_court_order', 'NO')
self.create_response('what_parenting_arrangements', 'Something')
self.create_response('want_parenting_arrangements', 'NO')
self.create_response('child_support_act', 'NO')
self.assertFalse(self.is_step_complete(substep))
# Based on child_support_in_order value (MATCH)
self.create_response('order_for_child_support', 'We are asking for X')
self.assertTrue(self.is_step_complete(substep))
# Based on child_support_in_order value (DIFF)
self.create_response('child_support_in_order', 'DIFF')
self.assertFalse(self.is_step_complete(substep))
self.create_response('order_monthly_child_support_amount', '100')
self.create_response('claimants_agree_to_child_support_amount', 'YES')
self.assertTrue(self.is_step_complete(substep))
self.create_response('claimants_agree_to_child_support_amount', 'NO')
self.create_response('child_support_payment_special_provisions', 'Some special provisions')
self.assertTrue(self.is_step_complete(substep))
# Based on child_support_in_order value (NO)
self.create_response('child_support_in_order', 'NO')
self.assertFalse(self.is_step_complete(substep))
self.create_response('child_support_in_order_reason', 'We will sort it out ourselves')
self.delete_response(['order_for_child_support', 'claimants_agree_to_child_support_amount', 'child_support_payment_special_provisions'])
self.assertTrue(self.is_step_complete(substep))
# Other conditionals
self.create_response('want_parenting_arrangements', 'YES')
self.assertFalse(self.is_step_complete(substep))
self.create_response('order_respecting_arrangement', 'Claimant 1 and Claimant 2 will share parenting time equally between them.')
self.assertTrue(self.is_step_complete(substep))

+ 2
- 0
edivorce/apps/core/utils/question_step_mapping.py View File

@ -109,6 +109,8 @@ children_substep_question_mapping = {
'child_support_arrears_amount',
},
'what_for': {
# child_support_in_order is not here because it can get pre-populated, and we don't want
# it to be counted as an "answer" for determining Skipped and Started statuses
'order_monthly_child_support_amount',
'child_support_in_order_reason',
'claimants_agree_to_child_support_amount',


Loading…
Cancel
Save