From 8687b87050e9b73d120834d135c648770dbb5ea5 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 6 Sep 2017 16:55:14 -0300 Subject: [PATCH] Ajusta mais uns PEP8 --- sapl/materia/views.py | 4 ++-- sapl/norma/tests/test_norma.py | 8 +++---- sapl/painel/views.py | 4 ++-- sapl/protocoloadm/forms.py | 2 +- sapl/protocoloadm/tests/test_protocoloadm.py | 22 ++++++++++---------- sapl/sessao/tests/test_sessao.py | 10 ++++----- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 80e5e9a1d..aa5aff472 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -2,6 +2,7 @@ from datetime import datetime from random import choice from string import ascii_letters, digits +import weasyprint from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML from django.contrib import messages @@ -12,7 +13,7 @@ from django.core.urlresolvers import reverse from django.http import HttpResponse, JsonResponse from django.http.response import Http404, HttpResponseRedirect from django.shortcuts import get_object_or_404, redirect -from django.template import Context, RequestContext, loader +from django.template import RequestContext, loader from django.utils import formats from django.utils.translation import ugettext_lazy as _ from django.views.generic import CreateView, ListView, TemplateView, UpdateView @@ -21,7 +22,6 @@ from django.views.generic.edit import FormView from django_filters.views import FilterView import sapl -import weasyprint from sapl.base.models import Autor, CasaLegislativa from sapl.comissoes.models import Comissao, Participacao from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_RESTRICT, diff --git a/sapl/norma/tests/test_norma.py b/sapl/norma/tests/test_norma.py index 72c27b22a..58816be48 100644 --- a/sapl/norma/tests/test_norma.py +++ b/sapl/norma/tests/test_norma.py @@ -98,10 +98,10 @@ def test_norma_juridica_materia_inexistente(): def test_norma_juridica_materia_existente(): tipo = mommy.make(TipoNormaJuridica) tipo_materia = mommy.make(TipoMateriaLegislativa) - materia = mommy.make(MateriaLegislativa, - numero=2, - ano=2017, - tipo=tipo_materia) + mommy.make(MateriaLegislativa, + numero=2, + ano=2017, + tipo=tipo_materia) form = NormaJuridicaForm(data={'tipo': str(tipo.pk), 'numero': '1', diff --git a/sapl/painel/views.py b/sapl/painel/views.py index 64deab910..5cb707181 100644 --- a/sapl/painel/views.py +++ b/sapl/painel/views.py @@ -12,11 +12,11 @@ from django.utils.translation import ugettext_lazy as _ from sapl.crud.base import Crud from sapl.painel.apps import AppConfig -from sapl.parlamentares.models import Filiacao, Votante +from sapl.parlamentares.models import Votante from sapl.sessao.models import (ExpedienteMateria, OrdemDia, PresencaOrdemDia, RegistroVotacao, SessaoPlenaria, SessaoPlenariaPresenca, VotoParlamentar) -from sapl.utils import filiacao_data, get_client_ip, parlamentares_ativos +from sapl.utils import filiacao_data, get_client_ip from .models import Cronometro diff --git a/sapl/protocoloadm/forms.py b/sapl/protocoloadm/forms.py index aa40f9d71..433212094 100644 --- a/sapl/protocoloadm/forms.py +++ b/sapl/protocoloadm/forms.py @@ -3,7 +3,7 @@ from datetime import datetime import django_filters from crispy_forms.bootstrap import InlineRadios from crispy_forms.helper import FormHelper -from crispy_forms.layout import HTML, Button, Fieldset, Layout, Submit +from crispy_forms.layout import HTML, Button, Fieldset, Layout from django import forms from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models diff --git a/sapl/protocoloadm/tests/test_protocoloadm.py b/sapl/protocoloadm/tests/test_protocoloadm.py index aa0da3b52..abf95666c 100644 --- a/sapl/protocoloadm/tests/test_protocoloadm.py +++ b/sapl/protocoloadm/tests/test_protocoloadm.py @@ -287,7 +287,7 @@ def test_anular_protocolo_form_anula_protocolo_inexistente(): @pytest.mark.django_db(transaction=False) def test_anular_protocolo_form_anula_protocolo_anulado(): - protocolo = mommy.make(Protocolo, numero=1, ano=2017, anulado=True) + mommy.make(Protocolo, numero=1, ano=2017, anulado=True) form = AnularProcoloAdmForm(data={'numero': '1', 'ano': '2017', @@ -304,15 +304,15 @@ def test_anular_protocolo_form_anula_protocolo_anulado(): def test_anular_protocolo_form_anula_protocolo_com_doc_vinculado(): tipo_materia = mommy.make(TipoMateriaLegislativa) - protocolo_materia = mommy.make(Protocolo, - numero=1, - ano=2017, - tipo_materia=tipo_materia, - anulado=False) + mommy.make(Protocolo, + numero=1, + ano=2017, + tipo_materia=tipo_materia, + anulado=False) - materia_legislativa = mommy.make(MateriaLegislativa, - ano=2017, - numero_protocolo=1) + mommy.make(MateriaLegislativa, + ano=2017, + numero_protocolo=1) form = AnularProcoloAdmForm(data={'numero': '1', 'ano': '2017', @@ -333,8 +333,8 @@ def test_anular_protocolo_form_anula_protocolo_com_doc_vinculado(): tipo_documento=tipo_documento, anulado=False) - documento_administrativo = mommy.make(DocumentoAdministrativo, - protocolo=protocolo_documento) + mommy.make(DocumentoAdministrativo, + protocolo=protocolo_documento) form = AnularProcoloAdmForm(data={'numero': '2', 'ano': '2017', diff --git a/sapl/sessao/tests/test_sessao.py b/sapl/sessao/tests/test_sessao.py index 7142aa48f..d92f7cabb 100644 --- a/sapl/sessao/tests/test_sessao.py +++ b/sapl/sessao/tests/test_sessao.py @@ -46,11 +46,11 @@ def test_numero_duplicado_sessao_plenaria_form(): legislatura = mommy.make(Legislatura) sessao = mommy.make(SessaoLegislativa) tipo = mommy.make(TipoSessaoPlenaria) - sessao_plenaria = mommy.make(SessaoPlenaria, - legislatura=legislatura, - sessao_legislativa=sessao, - tipo=tipo, - numero=1) + mommy.make(SessaoPlenaria, + legislatura=legislatura, + sessao_legislativa=sessao, + tipo=tipo, + numero=1) form = forms.SessaoPlenariaForm(data={'legislatura': str(legislatura.pk), 'numero': '1',