From 74540d4a6fff1894369fe3c253cfb3eb333d6312 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 15 Apr 2019 16:25:53 -0300 Subject: [PATCH] HOT-FIX: corrige erro de grafia --- sapl/protocoloadm/forms.py | 6 ++-- sapl/protocoloadm/tests/test_protocoloadm.py | 32 ++++++++++---------- sapl/protocoloadm/views.py | 4 +-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sapl/protocoloadm/forms.py b/sapl/protocoloadm/forms.py index b47b093dc..ef013703d 100644 --- a/sapl/protocoloadm/forms.py +++ b/sapl/protocoloadm/forms.py @@ -221,7 +221,7 @@ class DocumentoAdministrativoFilterSet(django_filters.FilterSet): ) -class AnularProcoloAdmForm(ModelForm): +class AnularProtocoloAdmForm(ModelForm): logger = logging.getLogger(__name__) @@ -240,7 +240,7 @@ class AnularProcoloAdmForm(ModelForm): widget=forms.Textarea) def clean(self): - super(AnularProcoloAdmForm, self).clean() + super(AnularProtocoloAdmForm, self).clean() cleaned_data = self.cleaned_data @@ -313,7 +313,7 @@ class AnularProcoloAdmForm(ModelForm): form_actions(label='Anular') ) ) - super(AnularProcoloAdmForm, self).__init__( + super(AnularProtocoloAdmForm, self).__init__( *args, **kwargs) diff --git a/sapl/protocoloadm/tests/test_protocoloadm.py b/sapl/protocoloadm/tests/test_protocoloadm.py index 0e43aebbe..f3c167288 100644 --- a/sapl/protocoloadm/tests/test_protocoloadm.py +++ b/sapl/protocoloadm/tests/test_protocoloadm.py @@ -9,7 +9,7 @@ import pytest from sapl.base.models import AppConfig from sapl.materia.models import UnidadeTramitacao -from sapl.protocoloadm.forms import (AnularProcoloAdmForm, +from sapl.protocoloadm.forms import (AnularProtocoloAdmForm, DocumentoAdministrativoForm, MateriaLegislativa, ProtocoloDocumentForm, ProtocoloMateriaForm) @@ -51,7 +51,7 @@ def test_anular_protocolo_submit(admin_client): @pytest.mark.django_db(transaction=False) def test_form_anular_protocolo_inexistente(): - form = AnularProcoloAdmForm({'numero': '1', + form = AnularProtocoloAdmForm({'numero': '1', 'ano': '2016', 'justificativa_anulacao': 'TESTE'}) @@ -64,7 +64,7 @@ def test_form_anular_protocolo_inexistente(): @pytest.mark.django_db(transaction=False) def test_form_anular_protocolo_valido(): mommy.make(Protocolo, numero='1', ano='2016', anulado=False) - form = AnularProcoloAdmForm({'numero': '1', + form = AnularProtocoloAdmForm({'numero': '1', 'ano': '2016', 'justificativa_anulacao': 'TESTE'}) if not form.is_valid(): @@ -74,7 +74,7 @@ def test_form_anular_protocolo_valido(): @pytest.mark.django_db(transaction=False) def test_form_anular_protocolo_anulado(): mommy.make(Protocolo, numero='1', ano='2016', anulado=True) - form = AnularProcoloAdmForm({'numero': '1', + form = AnularProtocoloAdmForm({'numero': '1', 'ano': '2016', 'justificativa_anulacao': 'TESTE'}) assert form.errors['__all__'] == \ @@ -88,7 +88,7 @@ def test_form_anular_protocolo_campos_obrigatorios(): # TODO: generalizar para diminuir o tamanho deste método # numero ausente - form = AnularProcoloAdmForm({'numero': '', + form = AnularProtocoloAdmForm({'numero': '', 'ano': '2016', 'justificativa_anulacao': 'TESTE'}) if form.is_valid(): @@ -98,7 +98,7 @@ def test_form_anular_protocolo_campos_obrigatorios(): assert form.errors['numero'] == [_('Este campo é obrigatório.')] # ano ausente - form = AnularProcoloAdmForm({'numero': '1', + form = AnularProtocoloAdmForm({'numero': '1', 'ano': '', 'justificativa_anulacao': 'TESTE'}) if form.is_valid(): @@ -108,7 +108,7 @@ def test_form_anular_protocolo_campos_obrigatorios(): assert form.errors['ano'] == [_('Este campo é obrigatório.')] # justificativa_anulacao ausente - form = AnularProcoloAdmForm({'numero': '1', + form = AnularProtocoloAdmForm({'numero': '1', 'ano': '2016', 'justificativa_anulacao': ''}) if form.is_valid(): @@ -261,7 +261,7 @@ def test_create_tramitacao(admin_client): @pytest.mark.django_db(transaction=False) def test_anular_protocolo_dados_invalidos(): - form = AnularProcoloAdmForm(data={}) + form = AnularProtocoloAdmForm(data={}) assert not form.is_valid() @@ -276,10 +276,10 @@ def test_anular_protocolo_dados_invalidos(): @pytest.mark.django_db(transaction=False) def test_anular_protocolo_form_anula_protocolo_inexistente(): - form = AnularProcoloAdmForm(data={'numero': '1', + form = AnularProtocoloAdmForm(data={'numero': '1', 'ano': '2017', 'justificativa_anulacao': 'teste' - }) + }) assert not form.is_valid() @@ -291,10 +291,10 @@ def test_anular_protocolo_form_anula_protocolo_inexistente(): def test_anular_protocolo_form_anula_protocolo_anulado(): mommy.make(Protocolo, numero=1, ano=2017, anulado=True) - form = AnularProcoloAdmForm(data={'numero': '1', + form = AnularProtocoloAdmForm(data={'numero': '1', 'ano': '2017', 'justificativa_anulacao': 'teste' - }) + }) assert not form.is_valid() @@ -316,10 +316,10 @@ def test_anular_protocolo_form_anula_protocolo_com_doc_vinculado(): ano=2017, numero_protocolo=1) - form = AnularProcoloAdmForm(data={'numero': '1', + form = AnularProtocoloAdmForm(data={'numero': '1', 'ano': '2017', 'justificativa_anulacao': 'teste' - }) + }) assert not form.is_valid() @@ -338,10 +338,10 @@ def test_anular_protocolo_form_anula_protocolo_com_doc_vinculado(): mommy.make(DocumentoAdministrativo, protocolo=protocolo_documento) - form = AnularProcoloAdmForm(data={'numero': '2', + form = AnularProtocoloAdmForm(data={'numero': '2', 'ano': '2017', 'justificativa_anulacao': 'teste' - }) + }) assert not form.is_valid() diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index 0c2e13157..6cefc9b0a 100755 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -37,7 +37,7 @@ from sapl.utils import (create_barcode, get_base_url, get_client_ip, get_mime_type_from_file_extension, show_results_filter_set, mail_service_configured) -from .forms import (AcompanhamentoDocumentoForm, AnularProcoloAdmForm, +from .forms import (AcompanhamentoDocumentoForm, AnularProtocoloAdmForm, DocumentoAcessorioAdministrativoForm, DocumentoAdministrativoFilterSet, DocumentoAdministrativoForm, FichaPesquisaAdmForm, FichaSelecionaAdmForm, ProtocoloDocumentForm, @@ -484,7 +484,7 @@ class ProtocoloListView(PermissionRequiredMixin, ListView): class AnularProtocoloAdmView(PermissionRequiredMixin, CreateView): template_name = 'protocoloadm/anular_protocoloadm.html' - form_class = AnularProcoloAdmForm + form_class = AnularProtocoloAdmForm form_valid_message = _('Protocolo anulado com sucesso!') permission_required = ('protocoloadm.action_anular_protocolo', )