def test_necessario(self):
        self.assertTrue(self.seg_p)

        seg_p2 = itau.registros.SegmentoP()
        self.assertFalse(seg_p2.necessario())

        seg_p2.controle_banco = 33
        self.assertFalse(seg_p2.necessario())

        seg_p2.vencimento_titulo = 10102012
        self.assertTrue(seg_p2.necessario())
def test_validation_with_invalid_language_code_type_raise_exception(self):
        self.assertEqual(self.voiceover_application.language_code, 'en')
        self.voiceover_application.validate()

        self.voiceover_application.language_code = 1
        with self.assertRaisesRegex(
            utils.ValidationError, 'Expected language_code to be a string'
        ):
            self.voiceover_application.validate()