-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Criado página de detalhamento do módulo
close #82
- Loading branch information
1 parent
ec70e1e
commit 62aa201
Showing
4 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% extends 'base/base.html' %} | ||
{% block title %}{{ modulo.titulo }}{% endblock title %} | ||
{% block description %}Página com detalhes do módulo {{ modulo.titulo }}{% endblock description %} | ||
{% block body %} | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h1 class="mt-4 mb-3">{{ modulo.titulo }}</h1> | ||
<dl> | ||
<dt>Público</dt> | ||
<dd>{{ modulo.publico }}</dd> | ||
<dt>Descrição</dt> | ||
<dd>{{ modulo.descricao }}</dd> | ||
</dl> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock body %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from django.urls import reverse | ||
import pytest | ||
from pypro.django_assertions import assert_contains | ||
from model_bakery import baker | ||
|
||
from pypro.modulos.models import Modulo | ||
|
||
|
||
@pytest.fixture | ||
def modulo(db): | ||
return baker.make(Modulo) | ||
|
||
|
||
@pytest.fixture | ||
def resp(client, modulo): | ||
resp = client.get(reverse('modulos:detalhe', kwargs={'slug': modulo.slug})) | ||
return resp | ||
|
||
|
||
def test_titulo(resp, modulo: Modulo): | ||
assert_contains(resp, modulo.titulo) | ||
|
||
|
||
def test_descricao(resp, modulo: Modulo): | ||
assert_contains(resp, modulo.descricao) | ||
|
||
|
||
def test_publico(resp, modulo: Modulo): | ||
assert_contains(resp, modulo.publico) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
from django.shortcuts import render | ||
|
||
from pypro.modulos import facade | ||
|
||
|
||
def detalhe(request, slug): | ||
pass | ||
modulo = facade.encontrar_modulo(slug) | ||
return render(request, 'modulos/modulo_detalhe.html', {'modulo': modulo}) |