Browse Source

DIV-371: Updated complete state and minor clean up

pull/160/head
Charles Shin 8 years ago
parent
commit
59c1d2a836
3 changed files with 15 additions and 17 deletions
  1. +4
    -6
      edivorce/apps/core/templates/question/07_property.html
  2. +10
    -10
      edivorce/apps/core/tests.py
  3. +1
    -1
      edivorce/fixtures/Question.json

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

@ -126,12 +126,10 @@
<p>
You can ask for an interest in the property (part ownership) or compensation (money). If the property is real estate, provide the legal description.
</p>
<div class="checkbox-group">
<div class="checkbox">
<label>
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>
</div>
<div>
<label>
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>
</div>
{% input_field type="textarea" name="other_property_claims" rows="8" cols="65" class="response-textarea" %}
</div>


+ 10
- 10
edivorce/apps/core/tests.py View File

@ -342,15 +342,9 @@ class UserResponseTestCase(TestCase):
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)
# Only one required question with no hidden shown
# All required question with no hidden shown
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], False)
# 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')
self.assertEqual(is_complete(step, lst)[0], True)
@ -360,7 +354,7 @@ class UserResponseTestCase(TestCase):
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)
# All required question with hidden shown and answered
# Only one required question with hidden shown and answered
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')
@ -373,11 +367,17 @@ class UserResponseTestCase(TestCase):
# 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)
# 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')
self.assertEqual(is_complete(step, lst)[0], True)
# Put empty response
UserResponse.objects.filter(question_id='other_property_claims').update(value="")
# UserResponse.objects.filter(question_id='want_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')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(is_complete(step, lst)[0], True)
def test_other_orders(self):
step = 'other_orders'


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

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


Loading…
Cancel
Save