From 68069a3ab6e3a42fd3c8d4b0e9437203529d58f5 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Mon, 27 Jul 2015 16:12:24 -0300 Subject: [PATCH] Fix broken tests --- sapl/test_crud.py | 8 ++++---- sapl/teststubs/urls_for_list_test.py | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sapl/test_crud.py b/sapl/test_crud.py index 4f99a0ca4..2bdbb2c05 100644 --- a/sapl/test_crud.py +++ b/sapl/test_crud.py @@ -178,8 +178,8 @@ def assert_on_create_page(res): def assert_on_detail_page(res, stub_name): assert_h1(res, stub_name) assert not res.forms - assert 'Editar Comissão' in res - assert 'Excluir Comissão' in res + assert 'Editar' in res + assert 'Excluir' in res @pytest.mark.urls('sapl.teststubs.urls_for_list_test') @@ -315,7 +315,7 @@ def get_detail_page(app): @pytest.mark.parametrize("cancel", [True, False]) def test_flux_detail_update_detail(app, cancel): stub, res = get_detail_page(app) - res = res.click('Editar Comissão') + res = res.click('Editar') # on update page assert_h1(res, stub.nome) @@ -346,7 +346,7 @@ def test_flux_detail_update_detail(app, cancel): @pytest.mark.parametrize("cancel", [True, False]) def test_flux_detail_delete_list(app, cancel): stub, res = get_detail_page(app) - res = res.click('Excluir Comissão') + res = res.click('Excluir') # on delete page assert 'Tem certeza que deseja apagar' in res diff --git a/sapl/teststubs/urls_for_list_test.py b/sapl/teststubs/urls_for_list_test.py index 07a76bd89..f8364a721 100644 --- a/sapl/teststubs/urls_for_list_test.py +++ b/sapl/teststubs/urls_for_list_test.py @@ -2,7 +2,7 @@ from django.conf.urls import include, url from sapl.crud import build_crud from comissoes.models import Comissao - +from comissoes.urls import comissoes_urls crud = build_crud( Comissao, @@ -17,6 +17,10 @@ crud = build_crud( ], ) +patterns, namespace, app_name = comissoes_urls + urlpatterns = [ - url(r'^comissoes/', include(crud.urls)), + url(r'^comissoes/', include(( + crud.urlpatterns + patterns[len(crud.urlpatterns):], + namespace, app_name))), ]