From 62c876fe35ba79e66cf8b9c24849f23478d9d2dc Mon Sep 17 00:00:00 2001 From: Mariana Mendes Date: Wed, 15 Aug 2018 13:10:11 -0300 Subject: [PATCH] =?UTF-8?q?HOT-FIX=20-=20Teste=20audi=C3=AAncia=20(#2144)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adiciona mais um teste referente ao forms de audiencia * hotfix --- sapl/audiencia/tests/test_audiencia.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sapl/audiencia/tests/test_audiencia.py b/sapl/audiencia/tests/test_audiencia.py index f617d426a..5640b3d0d 100644 --- a/sapl/audiencia/tests/test_audiencia.py +++ b/sapl/audiencia/tests/test_audiencia.py @@ -3,6 +3,8 @@ from django.utils.translation import ugettext as _ from model_mommy import mommy from sapl.audiencia import forms +from sapl.audiencia.models import TipoAudienciaPublica +from sapl.materia.models import MateriaLegislativa, TipoMateriaLegislativa @pytest.mark.django_db(transaction=False) def test_valida_campos_obrigatorios_audiencia_form(): @@ -19,3 +21,21 @@ def test_valida_campos_obrigatorios_audiencia_form(): assert errors['hora_inicio'] == [_('Este campo é obrigatório.')] assert len(errors) == 5 + + +@pytest.mark.django_db(transaction=False) +def test_audiencia_form_hora_invalida(): + tipo_materia = mommy.make(TipoMateriaLegislativa) + + tipo = mommy.make(TipoAudienciaPublica) + + form = forms.AudienciaForm(data={'nome': 'Nome da Audiencia', + 'tema': 'Tema da Audiencia', + 'tipo': tipo, + 'data': '2016-10-01', + 'hora_inicio': '10:00', + 'hora_fim': '9:00', + }) + assert not form.is_valid() + + \ No newline at end of file