Browse Source

DIV-371: Removed checkbox on Other Property Claims

pull/160/head
Charles Shin 8 years ago
parent
commit
bc432b84d3
6 changed files with 23 additions and 27 deletions
  1. +3
    -4
      edivorce/apps/core/templates/pdf/form1.html
  2. +1
    -1
      edivorce/apps/core/templates/question/07_property.html
  3. +2
    -4
      edivorce/apps/core/templatetags/summary_format.py
  4. +15
    -14
      edivorce/apps/core/tests.py
  5. +1
    -1
      edivorce/apps/core/utils/question_step_mapping.py
  6. +1
    -3
      edivorce/fixtures/Question.json

+ 3
- 4
edivorce/apps/core/templates/pdf/form1.html View File

@ -336,9 +336,8 @@
<td> <strong> B Other property claims </strong> </td> <td> <strong> B Other property claims </strong> </td>
</tr> </tr>
<tr> <tr>
{% check_list source=responses.want_other_property_claims value='Ask for other property claims' as other_wanted %}
<td> <i class="fa {% if other_wanted %} fa-check-square-o {% else %} fa-square-o{% endif %}" aria-hidden="true"></i> Claimant 1 and Claimant 2 ask for an order respecting an interest in property or for compensation instead of an interest in that property, as follows:
<span class="form-entry form-textarea not-complete">{% if other_wanted and responses.other_property_claims %} {{ responses.other_property_claims|striptags|linebreaksul }} {% else %}&nbsp;{% endif %}</span> </td>
<td> <i class="fa {% if responses.other_property_claims %} fa-check-square-o {% else %} fa-square-o{% endif %}" aria-hidden="true"></i> Claimant 1 and Claimant 2 ask for an order respecting an interest in property or for compensation instead of an interest in that property, as follows:
<span class="form-entry form-textarea not-complete">{% if responses.other_property_claims %} {{ responses.other_property_claims|striptags|linebreaksul }} {% else %}&nbsp;{% endif %}</span> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -348,7 +347,7 @@
<tbody> <tbody>
<tr> <tr>
{% check_list source=responses.want_which_orders value='Other orders' as order_wanted %} {% check_list source=responses.want_which_orders value='Other orders' as order_wanted %}
<td> <i class="fa {% if order_wanted %} fa-check-square-o {% else %} fa-square-o {% endif %}" aria-hidden="true"></i> Claimant 1 and Claimant 2 are asking for an order in the following terms: <span class="form-entry form-textarea not-complete">{% if responses.other_orders_detail %} {{ responses.other_orders_detail|striptags|linebreaksul }} {% else %} &nbsp; {% endif %}</span>
<td> <i class="fa {% if order_wanted %} fa-check-square-o {% else %} fa-square-o {% endif %}" aria-hidden="true"></i> Claimant 1 and Claimant 2 are asking for an order in the following terms: <span class="form-entry form-textarea not-complete">{% if responses.other_orders_detail and order_wanted %} {{ responses.other_orders_detail|striptags|linebreaksul }} {% else %} &nbsp; {% endif %}</span>
<p class="text-center"> <p class="text-center">
[<em>set out terms of proposed order</em>] [<em>set out terms of proposed order</em>]
</p> </p>


+ 1
- 1
edivorce/apps/core/templates/question/07_property.html View File

@ -129,7 +129,7 @@
<div class="checkbox-group"> <div class="checkbox-group">
<div class="checkbox"> <div class="checkbox">
<label> <label>
{% input_field type="checkbox" name="want_other_property_claims" value="Ask for other property claims" %} Claimant 1 and Claimant 2 ask for an order respecting an interest in property or for compensation instead of an interest in that property, as follows:
Claimant 1 and Claimant 2 ask for an order respecting an interest in property or for compensation instead of an interest in that property, as follows:
</label> </label>
</div> </div>
</div> </div>


+ 2
- 4
edivorce/apps/core/templatetags/summary_format.py View File

@ -192,7 +192,7 @@ def property_tag(source):
second_column = '</td><td width="25%">' second_column = '</td><td width="25%">'
end_tag = '</td></tr>' end_tag = '</td></tr>'
division = division_detail = want_other = other_detail = None
division = division_detail = other_detail = None
for item in source: for item in source:
q_id = item['question_id'] q_id = item['question_id']
@ -201,8 +201,6 @@ def property_tag(source):
division = item division = item
elif q_id == 'how_to_divide_property_debt': elif q_id == 'how_to_divide_property_debt':
division_detail = item division_detail = item
elif q_id == 'want_other_property_claims':
want_other = item
elif q_id == 'other_property_claims': elif q_id == 'other_property_claims':
other_detail = item other_detail = item
@ -210,7 +208,7 @@ def property_tag(source):
tags.append(first_column + division['question__name'] + second_column + division['value'] + end_tag) tags.append(first_column + division['question__name'] + second_column + division['value'] + end_tag)
if division and division['value'] == "Unequal division" and division_detail: if division and division['value'] == "Unequal division" and division_detail:
tags.append(first_column + division_detail['question__name'] + second_column + process_list(division_detail['value'].split('\n'), division_detail['question_id']) + end_tag) tags.append(first_column + division_detail['question__name'] + second_column + process_list(division_detail['value'].split('\n'), division_detail['question_id']) + end_tag)
if want_other and other_detail:
if other_detail and other_detail['value'].strip():
tags.append(first_column + other_detail['question__name'] + second_column + process_list(other_detail['value'].split('\n'), other_detail['question_id']) + end_tag) tags.append(first_column + other_detail['question__name'] + second_column + process_list(other_detail['value'].split('\n'), other_detail['question_id']) + end_tag)
return ''.join(tags) return ''.join(tags)


+ 15
- 14
edivorce/apps/core/tests.py View File

@ -342,41 +342,42 @@ class UserResponseTestCase(TestCase):
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required') lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False) self.assertEqual(is_complete(step, lst)[0], False)
# All required question with no hidden shown
# Only one required question with no hidden shown
create_response(user, 'deal_with_property_debt', 'Equal division') create_response(user, 'deal_with_property_debt', 'Equal division')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
# All required question with hidden shown but no response
UserResponse.objects.filter(question_id='deal_with_property_debt').update(value="Unequal division")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required') lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False) self.assertEqual(is_complete(step, lst)[0], False)
# Only one required question with hidden shown and answered
create_response(user, 'how_to_divide_property_debt', 'Do not divide them')
# All required question with hidden shown and answered
create_response(user, 'other_property_claims', 'Want these property claims')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required') lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True) self.assertEqual(is_complete(step, lst)[0], True)
# Only two required question with hidden shown and answered
create_response(user, 'want_other_property_claims', '["Ask for other property claims"]')
# All required question with hidden shown but no response
UserResponse.objects.filter(question_id='deal_with_property_debt').update(value="Unequal division")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required') lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False) self.assertEqual(is_complete(step, lst)[0], False)
# All required question with hidden shown and answered # All required question with hidden shown and answered
create_response(user, 'other_property_claims', 'Want these property claims')
create_response(user, 'how_to_divide_property_debt', 'Do not divide them')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required') lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True) self.assertEqual(is_complete(step, lst)[0], True)
# Only two required question with hidden shown and answered
# NOTE: want_other_property_claims not in use anymore
# create_response(user, 'want_other_property_claims', '["Ask for other property claims"]')
#
# lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
# self.assertEqual(is_complete(step, lst)[0], False)
# Put empty response # Put empty response
UserResponse.objects.filter(question_id='want_other_property_claims').update(value="")
UserResponse.objects.filter(question_id='other_property_claims').update(value="")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required') lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.assertEqual(is_complete(step, lst)[0], False)
def test_other_orders(self): def test_other_orders(self):
step = 'other_orders' step = 'other_orders'


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

@ -18,7 +18,7 @@ question_step_mapping = {'prequalification': ['married_marriage_like', 'lived_in
'marital_status_before_spouse', 'when_were_you_live_married_like'], 'marital_status_before_spouse', 'when_were_you_live_married_like'],
'your_separation': ['no_reconciliation_possible', 'no_collusion',], 'your_separation': ['no_reconciliation_possible', 'no_collusion',],
'spousal_support': ['spouse_support_details', 'spouse_support_act',], 'spousal_support': ['spouse_support_details', 'spouse_support_act',],
'property_and_debt': ['deal_with_property_debt', 'how_to_divide_property_debt', 'other_property_claims', 'want_other_property_claims'],
'property_and_debt': ['deal_with_property_debt', 'how_to_divide_property_debt', 'other_property_claims'],
'other_orders': ['other_orders_detail'], 'other_orders': ['other_orders_detail'],
'other_questions': ['address_to_send_official_document_street_you', 'other_questions': ['address_to_send_official_document_street_you',
'address_to_send_official_document_city_you', 'address_to_send_official_document_city_you',


+ 1
- 3
edivorce/fixtures/Question.json View File

@ -532,9 +532,7 @@
"name": "Please list any other property claims.", "name": "Please list any other property claims.",
"description": "For step 7, Form 1 6. Property and debt", "description": "For step 7, Form 1 6. Property and debt",
"summary_order": 50, "summary_order": 50,
"required": "Conditional",
"conditional_target": "want_other_property_claims",
"reveal_response": "[\"Ask for other property claims\"]"
"required": "Required"
}, },
"model": "core.question", "model": "core.question",
"pk": "other_property_claims" "pk": "other_property_claims"


Loading…
Cancel
Save