def _get_all_question_sections(self): return ( section for section in self.schema.sections if not ( QuestionnaireSchema.is_summary_section(section) or QuestionnaireSchema.is_confirmation_section(section)) )
def test_is_confirmation(self): survey_json = { 'sections': [{ 'id': 'section-1', 'groups': [{ 'id': 'group-1', 'blocks': [ { 'id': 'block-1', 'type': 'Confirmation' } ] }] }] } schema = QuestionnaireSchema(survey_json) self.assertTrue(schema.is_confirmation_section(schema.get_section('section-1'))) self.assertTrue(schema.is_confirmation_group(schema.get_group('group-1'))) self.assertFalse(schema.is_summary_section(schema.get_section('section-1'))) self.assertFalse(schema.is_summary_group(schema.get_group('group-1')))