def test_confirm(self): editor = PaulistaInvoiceDialog(self.store, model=None) with mock.patch('plugins.ecf.paulistainvoicedialog.info') as info: self.click(editor.main_dialog.ok_button) info.assert_called_once_with('The CPF cannot be empty')
def test_on_document__validate_cpf(self): editor = PaulistaInvoiceDialog(self.store, model=None) editor.document.update(u"123.123.123-12") self.assertInvalid(editor, ['document'])
def test_on_document__validate_cnpj(self): editor = PaulistaInvoiceDialog(self.store, model=None) self.click(editor.cnpj) editor.document.update(u"11.222.333/4444-55") self.assertInvalid(editor, ['document'])
def test_show(self): editor = PaulistaInvoiceDialog(self.store, model=None) self.check_editor(editor, 'editor-paulista-invoice-cpf-show') self.click(editor.cnpj) self.check_editor(editor, 'editor-paulista-invoice-cnpj-show')