Browse Source

Conserta qa e testes

pull/323/head
Eduardo Edson Batista Cordeiro Alves 9 years ago
committed by Edward Ribeiro
parent
commit
be50605e55
  1. 5
      norma/forms.py
  2. 4
      norma/test_norma.py
  3. 5
      norma/views.py

5
norma/forms.py

@ -3,15 +3,12 @@ from datetime import datetime
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import Fieldset, Layout from crispy_forms.layout import Fieldset, Layout
from django import forms from django import forms
from django.contrib import messages from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.forms import ModelForm from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _
import crispy_layout_mixin import crispy_layout_mixin
from crispy_layout_mixin import form_actions from crispy_layout_mixin import form_actions
from materia.models import MateriaLegislativa, TipoMateriaLegislativa from materia.models import MateriaLegislativa, TipoMateriaLegislativa
from sapl.settings import MAX_DOC_UPLOAD_SIZE
from sapl.utils import RANGE_ANOS from sapl.utils import RANGE_ANOS
from .models import NormaJuridica from .models import NormaJuridica

4
norma/test_norma.py

@ -13,7 +13,7 @@ def test_incluir_norma_submit(client):
descricao='Teste') descricao='Teste')
# Testa POST # Testa POST
response = client.post(reverse('norma:norma_incluir'), response = client.post(reverse('norma:normajuridica_create'),
{'tipo': tipo.pk, {'tipo': tipo.pk,
'numero': '1', 'numero': '1',
'ano': '2016', 'ano': '2016',
@ -33,7 +33,7 @@ def test_incluir_norma_submit(client):
@pytest.mark.django_db(transaction=False) @pytest.mark.django_db(transaction=False)
def test_incluir_norma_errors(client): def test_incluir_norma_errors(client):
response = client.post(reverse('norma:norma_incluir'), response = client.post(reverse('norma:normajuridica_create'),
{'salvar': 'salvar'}, {'salvar': 'salvar'},
follow=True) follow=True)

5
norma/views.py

@ -1,14 +1,11 @@
from datetime import datetime from datetime import datetime
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponseRedirect
from django.shortcuts import redirect from django.shortcuts import redirect
from django.views.generic import CreateView, FormView, ListView, UpdateView from django.views.generic import FormView, ListView
import crud.base import crud.base
from compilacao.views import IntegracaoTaView from compilacao.views import IntegracaoTaView
from crud.base import Crud, make_pagination from crud.base import Crud, make_pagination
from materia.models import MateriaLegislativa
from .forms import NormaJuridicaForm, NormaJuridicaPesquisaForm from .forms import NormaJuridicaForm, NormaJuridicaPesquisaForm
from .models import (AssuntoNorma, LegislacaoCitada, NormaJuridica, from .models import (AssuntoNorma, LegislacaoCitada, NormaJuridica,

Loading…
Cancel
Save