diff --git a/l10n_br_cnpj_search/tests/common.py b/l10n_br_cnpj_search/tests/common.py index ce531fba22a9..a8737daa135e 100644 --- a/l10n_br_cnpj_search/tests/common.py +++ b/l10n_br_cnpj_search/tests/common.py @@ -64,73 +64,7 @@ def setUpClass(cls): ], "cep": "70836900", "correioEletronico": "EMPRESA@XXXXXX.BR", - "socios": [ - { - "tipoSocio": "2", - "cpf": "07119488449", - "nome": "LUIZA ARAUJO DE OLIVEIRA", - "qualificacao": "49", - "dataInclusao": "2014-01-01", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": { - "cpf": "00000000000", - "nome": "", - "qualificacao": "00", - }, - }, - { - "tipoSocio": "2", - "cpf": "23982012600", - "nome": "JOANA ALVES MUNDIM PENA", - "qualificacao": "49", - "dataInclusao": "2014-01-01", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": { - "cpf": "00000000000", - "nome": "", - "qualificacao": "00", - }, - }, - { - "tipoSocio": "2", - "cpf": "13946994415", - "nome": "LUIZA BARBOSA BEZERRA", - "qualificacao": "49", - "dataInclusao": "2014-01-01", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": { - "cpf": "00000000000", - "nome": "", - "qualificacao": "00", - }, - }, - { - "tipoSocio": "2", - "cpf": "00031298702", - "nome": "MARCELO ANTONIO BARROS DE CICCO", - "qualificacao": "49", - "dataInclusao": "2014-01-01", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": { - "cpf": "00000000000", - "nome": "", - "qualificacao": "00", - }, - }, - { - "tipoSocio": "2", - "cpf": "76822320300", - "nome": "LUIZA ALDENORA", - "qualificacao": "49", - "dataInclusao": "2014-01-01", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": { - "cpf": "00000000000", - "nome": "", - "qualificacao": "00", - }, - }, - ], + "socios": [], "endereco": { "tipoLogradouro": "SETOR", "logradouro": "NH BIWMNH WIHW MXIVH", @@ -150,166 +84,113 @@ def setUpClass(cls): }, } - cls.mocked_response_serpro_2 = { - "ni": "34238864000249", - "nomeEmpresarial": "UHIEQKX WHNHIWD NH FIXKHUUWPHMVX NH NWNXU (UHIFIX)", - "nomeFantasia": "UHIFIX UHNH", - "telefones": [ - {"ddd": "61", "numero": "22222222"}, - {"ddd": "61", "numero": "22222222"}, - ], - "cep": "70836900", - "correioEletronico": "EMPRESA@XXXXXX.BR", - "socios": [ - { - "tipoSocio": "2", - "cpf": "07119488449", - "nome": "LUIZA ARAUJO DE OLIVEIRA", - "qualificacao": "49", - "dataInclusao": "2014-01-01", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": { - "cpf": "00000000000", - "nome": "", - "qualificacao": "00", - }, + cls.mocked_response_serpro_2 = cls.mocked_response_serpro_1.copy() + cls.mocked_response_serpro_2["socios"] = [ + { + "tipoSocio": "2", + "cpf": "07119488449", + "nome": "LUIZA ARAUJO DE OLIVEIRA", + "qualificacao": "49", + "dataInclusao": "2014-01-01", + "pais": {"codigo": "105", "descricao": "BRASIL"}, + "representanteLegal": { + "cpf": "00000000000", + "nome": "", + "qualificacao": "00", }, - { - "tipoSocio": "2", - "cpf": "23982012600", - "nome": "JOANA ALVES MUNDIM PENA", - "qualificacao": "49", - "dataInclusao": "2014-01-01", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": { - "cpf": "00000000000", - "nome": "", - "qualificacao": "00", - }, + }, + { + "tipoSocio": "2", + "cpf": "23982012600", + "nome": "JOANA ALVES MUNDIM PENA", + "qualificacao": "49", + "dataInclusao": "2014-01-01", + "pais": {"codigo": "105", "descricao": "BRASIL"}, + "representanteLegal": { + "cpf": "00000000000", + "nome": "", + "qualificacao": "00", }, - { - "tipoSocio": "2", - "cpf": "13946994415", - "nome": "LUIZA BARBOSA BEZERRA", - "qualificacao": "49", - "dataInclusao": "2014-01-01", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": { - "cpf": "00000000000", - "nome": "", - "qualificacao": "00", - }, + }, + { + "tipoSocio": "2", + "cpf": "13946994415", + "nome": "LUIZA BARBOSA BEZERRA", + "qualificacao": "49", + "dataInclusao": "2014-01-01", + "pais": {"codigo": "105", "descricao": "BRASIL"}, + "representanteLegal": { + "cpf": "00000000000", + "nome": "", + "qualificacao": "00", }, - { - "tipoSocio": "2", - "cpf": "00031298702", - "nome": "MARCELO ANTONIO BARROS DE CICCO", - "qualificacao": "49", - "dataInclusao": "2014-01-01", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": { - "cpf": "00000000000", - "nome": "", - "qualificacao": "00", - }, + }, + { + "tipoSocio": "2", + "cpf": "00031298702", + "nome": "MARCELO ANTONIO BARROS DE CICCO", + "qualificacao": "49", + "dataInclusao": "2014-01-01", + "pais": {"codigo": "105", "descricao": "BRASIL"}, + "representanteLegal": { + "cpf": "00000000000", + "nome": "", + "qualificacao": "00", }, - { - "tipoSocio": "2", - "cpf": "76822320300", - "nome": "LUIZA ALDENORA", - "qualificacao": "49", - "dataInclusao": "2014-01-01", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": { - "cpf": "00000000000", - "nome": "", - "qualificacao": "00", - }, + }, + { + "tipoSocio": "2", + "cpf": "76822320300", + "nome": "LUIZA ALDENORA", + "qualificacao": "49", + "dataInclusao": "2014-01-01", + "pais": {"codigo": "105", "descricao": "BRASIL"}, + "representanteLegal": { + "cpf": "00000000000", + "nome": "", + "qualificacao": "00", }, - ], - "endereco": { - "tipoLogradouro": "SETOR", - "logradouro": "NH BIWMNH WIHW MXIVH", - "numero": "Q.601", - "complemento": "LOTE V", - "cep": "70836900", - "bairro": "ASA NORTE", - "municipio": {"codigo": "9701", "descricao": "BRASILIA"}, - "uf": "DF", + }, + ] + + cls.mocked_response_serpro_3 = cls.mocked_response_serpro_2.copy() + cls.mocked_response_serpro_3["socios"] = [ + { + "tipoSocio": "2", + "nome": "LUIZA ARAUJO DE OLIVEIRA", + "qualificacao": "49", "pais": {"codigo": "105", "descricao": "BRASIL"}, + "representanteLegal": {"nome": "", "qualificacao": "00"}, }, - "naturezaJuridica": {"codigo": "2011", "descricao": "Empresa Pública"}, - "capitalSocial": 0, - "cnaePrincipal": { - "codigo": "6204000", - "descricao": "Consultoria em tecnologia da informação", + { + "tipoSocio": "2", + "nome": "JOANA ALVES MUNDIM PENA", + "qualificacao": "49", + "pais": {"codigo": "105", "descricao": "BRASIL"}, + "representanteLegal": {"nome": "", "qualificacao": "00"}, }, - } - - cls.mocked_response_serpro_3 = { - "nomeEmpresarial": "UHIEQKX WHNHIWD NH FIXKHUUWPHMVX NH NWNXU (UHIFIX)", - "nomeFantasia": "UHIFIX UHNH", - "telefones": [ - {"ddd": "61", "numero": "22222222"}, - {"ddd": "61", "numero": "22222222"}, - ], - "cep": "70836900", - "correioEletronico": "EMPRESA@XXXXXX.BR", - "socios": [ - { - "tipoSocio": "2", - "nome": "LUIZA ARAUJO DE OLIVEIRA", - "qualificacao": "49", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": {"nome": "", "qualificacao": "00"}, - }, - { - "tipoSocio": "2", - "nome": "JOANA ALVES MUNDIM PENA", - "qualificacao": "49", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": {"nome": "", "qualificacao": "00"}, - }, - { - "tipoSocio": "2", - "nome": "LUIZA BARBOSA BEZERRA", - "qualificacao": "49", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": {"nome": "", "qualificacao": "00"}, - }, - { - "tipoSocio": "2", - "nome": "MARCELO ANTONIO BARROS DE CICCO", - "qualificacao": "49 ", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": {"nome": "", "qualificacao": "00"}, - }, - { - "tipoSocio": "2", - "nome": "LUIZA ALDENORA", - "qualificacao": "49", - "pais": {"codigo": "105", "descricao": "BRASIL"}, - "representanteLegal": {"nome": "", "qualificacao": "00"}, - }, - ], - "endereco": { - "tipoLogradouro": "SETOR", - "logradouro": "NH BIWMNH WIHW MXIVH", - "numero": "Q.601", - "complemento": "LOTE V", - "cep": "70836900", - "bairro": "ASA NORTE", - "municipio": {"codigo": "9701", "descricao": "BRASILIA"}, - "uf": "DF", + { + "tipoSocio": "2", + "nome": "LUIZA BARBOSA BEZERRA", + "qualificacao": "49", "pais": {"codigo": "105", "descricao": "BRASIL"}, + "representanteLegal": {"nome": "", "qualificacao": "00"}, }, - "naturezaJuridica": {"codigo": "2011", "descricao": "Empresa Pública"}, - "capitalSocial": 0, - "cnaePrincipal": { - "codigo": "6204000", - "descricao": "Consultoria em tecnologia da informação", + { + "tipoSocio": "2", + "nome": "MARCELO ANTONIO BARROS DE CICCO", + "qualificacao": "49 ", + "pais": {"codigo": "105", "descricao": "BRASIL"}, + "representanteLegal": {"nome": "", "qualificacao": "00"}, }, - } + { + "tipoSocio": "2", + "nome": "LUIZA ALDENORA", + "qualificacao": "49", + "pais": {"codigo": "105", "descricao": "BRASIL"}, + "representanteLegal": {"nome": "", "qualificacao": "00"}, + }, + ] def set_param(self, param_name, param_value): ( diff --git a/l10n_br_cnpj_search/tests/test_serpro.py b/l10n_br_cnpj_search/tests/test_serpro.py index 853d4f8fef2c..4a9b815907bc 100644 --- a/l10n_br_cnpj_search/tests/test_serpro.py +++ b/l10n_br_cnpj_search/tests/test_serpro.py @@ -126,7 +126,9 @@ def test_serpro_empresa(self): ) dummy_empresa._onchange_cnpj_cpf() - action_wizard = dummy_empresa.action_open_cnpj_search_wizard() + action_wizard = dummy_empresa.with_context( + disable_allow_cnpj_multi_ie=True + ).action_open_cnpj_search_wizard() wizard_context = action_wizard.get("context") wizard = ( self.env["partner.search.wizard"]