Ejemplo n.º 1
0
 def test_conf_reg_block_without_question_or_answer_passes_validation(self):
     block = ConferenceRegistrationForm()
     value = block.to_python({
         'govdelivery_code': 'USCFPB_999',
         'capacity': 123,
         'success_message': 'Success message',
         'at_capacity_message': 'At capacity message',
         'failure_message': 'Failure message'
     })
     self.assertTrue(block.clean(value))
Ejemplo n.º 2
0
    def test_conf_reg_block_without_question_or_answer_passes_validation(self):
        block = ConferenceRegistrationForm()
        value = block.to_python({
            'govdelivery_code': 'USCFPB_999',
            'capacity': 123,
            'success_message': 'Success message',
            'at_capacity_message': 'At capacity message',
            'failure_message': 'Failure message'
        })

        try:
            block.clean(value)
        except ValidationError:
            self.fail('no question and no answer should not fail validation')
Ejemplo n.º 3
0
    def test_conf_reg_block_with_answer_but_no_question_fails_validation(self):
        block = ConferenceRegistrationForm()
        value = block.to_python({
            'govdelivery_code': 'USCFPB_999',
            'govdelivery_question_id': '',
            'govdelivery_answer_id': '67890',
            'capacity': 123,
            'success_message': 'Success message',
            'at_capacity_message': 'At capacity message',
            'failure_message': 'Failure message'
        })

        with self.assertRaises(ValidationError):
            block.clean(value)
Ejemplo n.º 4
0
    def test_conf_reg_block_without_question_or_answer_passes_validation(self):
        block = ConferenceRegistrationForm()
        value = block.to_python({
            'govdelivery_code': 'USCFPB_999',
            'capacity': 123,
            'success_message': 'Success message',
            'at_capacity_message': 'At capacity message',
            'failure_message': 'Failure message'
        })

        try:
            block.clean(value)
        except ValidationError:
            self.fail('no question and no answer should not fail validation')
Ejemplo n.º 5
0
    def test_conf_reg_block_with_answer_but_no_question_fails_validation(self):
        block = ConferenceRegistrationForm()
        value = block.to_python({'govdelivery_answer_id': '67890'})

        with self.assertRaises(ValidationError):
            block.clean(value)
Ejemplo n.º 6
0
    def test_conf_reg_block_with_answer_but_no_question_fails_validation(self):
        block = ConferenceRegistrationForm()
        value = block.to_python({'govdelivery_answer_id': '67890'})

        with self.assertRaises(ValidationError):
            block.clean(value)