From be50605e55df0c49124c896158cec849a4f94c0f Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Wed, 13 Apr 2016 09:59:13 -0300 Subject: [PATCH] Conserta qa e testes --- norma/forms.py | 5 +---- norma/test_norma.py | 4 ++-- norma/views.py | 5 +---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/norma/forms.py b/norma/forms.py index 8320ebbe7..1f80f1b40 100644 --- a/norma/forms.py +++ b/norma/forms.py @@ -3,15 +3,12 @@ from datetime import datetime from crispy_forms.helper import FormHelper from crispy_forms.layout import Fieldset, Layout from django import forms -from django.contrib import messages -from django.core.exceptions import ObjectDoesNotExist, ValidationError +from django.core.exceptions import ObjectDoesNotExist from django.forms import ModelForm -from django.utils.translation import ugettext_lazy as _ import crispy_layout_mixin from crispy_layout_mixin import form_actions from materia.models import MateriaLegislativa, TipoMateriaLegislativa -from sapl.settings import MAX_DOC_UPLOAD_SIZE from sapl.utils import RANGE_ANOS from .models import NormaJuridica diff --git a/norma/test_norma.py b/norma/test_norma.py index 4731995b2..e25b3dbfd 100644 --- a/norma/test_norma.py +++ b/norma/test_norma.py @@ -13,7 +13,7 @@ def test_incluir_norma_submit(client): descricao='Teste') # Testa POST - response = client.post(reverse('norma:norma_incluir'), + response = client.post(reverse('norma:normajuridica_create'), {'tipo': tipo.pk, 'numero': '1', 'ano': '2016', @@ -33,7 +33,7 @@ def test_incluir_norma_submit(client): @pytest.mark.django_db(transaction=False) def test_incluir_norma_errors(client): - response = client.post(reverse('norma:norma_incluir'), + response = client.post(reverse('norma:normajuridica_create'), {'salvar': 'salvar'}, follow=True) diff --git a/norma/views.py b/norma/views.py index 875030249..e454ac7cc 100644 --- a/norma/views.py +++ b/norma/views.py @@ -1,14 +1,11 @@ from datetime import datetime -from django.core.urlresolvers import reverse_lazy -from django.http import HttpResponseRedirect from django.shortcuts import redirect -from django.views.generic import CreateView, FormView, ListView, UpdateView +from django.views.generic import FormView, ListView import crud.base from compilacao.views import IntegracaoTaView from crud.base import Crud, make_pagination -from materia.models import MateriaLegislativa from .forms import NormaJuridicaForm, NormaJuridicaPesquisaForm from .models import (AssuntoNorma, LegislacaoCitada, NormaJuridica,