mirror of https://github.com/interlegis/sapl.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.4 KiB
35 lines
1.4 KiB
import pytest
|
|
from django.core.urlresolvers import reverse
|
|
from sapl.translation import ugettext_lazy as _
|
|
|
|
|
|
@pytest.mark.django_db(transaction=False)
|
|
def test_incluir_casa_legislativa_errors(admin_client):
|
|
|
|
response = admin_client.post(reverse('sapl.base:casalegislativa_create'),
|
|
{'salvar': 'salvar'},
|
|
follow=True)
|
|
|
|
assert (response.context_data['form'].errors['nome'] ==
|
|
[_('Este campo é obrigatório.')])
|
|
assert (response.context_data['form'].errors['sigla'] ==
|
|
[_('Este campo é obrigatório.')])
|
|
assert (response.context_data['form'].errors['endereco'] ==
|
|
[_('Este campo é obrigatório.')])
|
|
assert (response.context_data['form'].errors['cep'] ==
|
|
[_('Este campo é obrigatório.')])
|
|
assert (response.context_data['form'].errors['municipio'] ==
|
|
[_('Este campo é obrigatório.')])
|
|
assert (response.context_data['form'].errors['uf'] ==
|
|
[_('Este campo é obrigatório.')])
|
|
|
|
|
|
@pytest.mark.django_db(transaction=False)
|
|
def test_incluir_tipo_autor_errors(admin_client):
|
|
|
|
response = admin_client.post(reverse('sapl.base:tipoautor_create'),
|
|
{'salvar': 'salvar'},
|
|
follow=True)
|
|
|
|
assert (response.context_data['form'].errors['descricao'] ==
|
|
[_('Este campo é obrigatório.')])
|
|
|