Browse Source

Add edit model link to detail view

pull/6/head
Marcio Mazza 10 years ago
parent
commit
e85a397a14
  1. 10
      sapl/test_crud.py
  2. 8
      templates/comissoes/comissao_detail.html

10
sapl/test_crud.py

@ -59,3 +59,13 @@ def test_flux_list_create_detail(app):
# on detail page
assert 'Registro criado com sucesso!' in res
assert_h1(res, stub_name)
def test_flux_detail_update_detail(app):
stub_name = 'Comissão Stub'
stub = mommy.make(Comissao, nome=stub_name)
res = app.get('/comissoes/%s' % stub.id)
assert_h1(res, stub_name)
assert not res.forms
res = res.click('Editar Comissão')

8
templates/comissoes/comissao_detail.html

@ -2,6 +2,14 @@
{% load i18n crispy_forms_tags %}
{% block base_content %}
{# FIXME is this the best markup to use? #}
<dl class="sub-nav">
<dd><a href="{{ view.update_url }}">
{% blocktrans with verbose_name=view.verbose_name %} Editar {{ verbose_name }} {% endblocktrans %}
</a></dd>
</dl>
TODO ...
{% endblock %}

Loading…
Cancel
Save