-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] l10n_ar_edi_ux: Add test_update_from_afip
- Loading branch information
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_update_from_afip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# -*- coding: utf-8 -*- | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
# from odoo.tests import HttpCase, tagged | ||
|
||
import odoo.tests.common as common | ||
from odoo import fields, Command | ||
|
||
class TestUpdateFromAfip(common.TransactionCase): | ||
|
||
def setUp(self): | ||
super().setUp() | ||
self.today = fields.Date.today() | ||
self.contacto_monotributo = self.env['res.partner'].create({ | ||
'name': 'Partner Monotributo', | ||
'street': 'Calle Falsa 123', | ||
'vat': '20221064233', | ||
'city': 'Rosario', | ||
'zip': '2000', | ||
'l10n_latam_identification_type_id': self.env.ref('l10n_ar.it_cuit').id, | ||
'state_id': self.env.ref('base.state_ar_s').id, | ||
}) | ||
self.contacto_Responsableinscripto = self.env['res.partner'].create({ | ||
'name': 'Partner Responsable Inscripto', | ||
'street': 'Calle Falsa 123', | ||
'vat': '20188027963', | ||
'city': 'Rosario', | ||
'zip': '2000', | ||
'l10n_latam_identification_type_id': self.env.ref('l10n_ar.it_cuit').id, | ||
'state_id': self.env.ref('base.state_ar_s').id, | ||
}) | ||
|
||
def testmonotributo(self): | ||
"""Actualizamos un contacto del tipo monotributo""" | ||
|
||
"""Chequeamos que no hay actividades ni impuestos creados""" | ||
self.assertEqual(self.env['afip.activity'], self.env['afip.activity'].search([]), "Activities are not being created.") | ||
self.assertEqual(self.env['afip.tax'], self.env['afip.tax'].search([]), "Taxes are not being created.") | ||
|
||
contacto = self.contacto_monotributo | ||
res_id = contacto.button_update_partner_data_from_afip()['res_id'] | ||
wiz = self.env['res.partner.update.from.padron.wizard'].browse(res_id) | ||
wiz.update_selection() | ||
|
||
|
||
self.assertEqual(contacto.name, 'Marjorier, Lamara', "Name after the update from afip must change") | ||
"""Chequeamos que las actividades e impuestos se hayan creado con la actualizacion""" | ||
self.assertNotEqual(contacto.actividades_padron, False, "Activities are not being created.") | ||
self.assertNotEqual(contacto.impuestos_padron, False, "Taxes are not being created.") | ||
|
||
def testresponsableinscripto(self): | ||
"""Actualizamos un contacto del tipo Responsable Inscripto""" | ||
|
||
"""Chequeamos que no hay actividades ni impuestos creados""" | ||
self.assertEqual(self.env['afip.activity'], self.env['afip.activity'].search([]), "Activities are not being created.") | ||
self.assertEqual(self.env['afip.tax'], self.env['afip.tax'].search([]), "Taxes are not being created.") | ||
|
||
contacto = self.contacto_Responsableinscripto | ||
res_id = contacto.button_update_partner_data_from_afip()['res_id'] | ||
wiz = self.env['res.partner.update.from.padron.wizard'].browse(res_id) | ||
wiz.update_selection() | ||
|
||
self.assertEqual(contacto.name, 'Paniagua Koler, Venancio', "Name after the update from afip must change") | ||
"""Chequeamos que las actividades e impuestos se hayan creado con la actualizacion""" | ||
self.assertNotEqual(contacto.actividades_padron, False, "Activities are not being created.") | ||
self.assertNotEqual(contacto.impuestos_padron, False, "Taxes are not being created.") |