From 053fe1f9b62ac60fc734bb19ff72d59b7be0fbe4 Mon Sep 17 00:00:00 2001 From: renzon Date: Wed, 17 Jan 2018 13:18:23 -0200 Subject: [PATCH 1/3] Added title to video page related #149 --- pythonpro/core/templates/core/base.html | 2 +- pythonpro/promos/templates/promos/video_detail.html | 2 ++ pythonpro/promos/tests/test_views.py | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pythonpro/core/templates/core/base.html b/pythonpro/core/templates/core/base.html index 15c44415..f482ab11 100644 --- a/pythonpro/core/templates/core/base.html +++ b/pythonpro/core/templates/core/base.html @@ -3,7 +3,7 @@ - Python Pro + {% block title %}Python Pro{% endblock %} diff --git a/pythonpro/promos/templates/promos/video_detail.html b/pythonpro/promos/templates/promos/video_detail.html index 1f29d697..106fe13e 100644 --- a/pythonpro/promos/templates/promos/video_detail.html +++ b/pythonpro/promos/templates/promos/video_detail.html @@ -1,9 +1,11 @@ {% extends 'core/base.html' %} {% load static %} +{% block title %}Motivação{% endblock %} {% block body %}
+

Motivação

diff --git a/pythonpro/promos/tests/test_views.py b/pythonpro/promos/tests/test_views.py index 023795ed..42a3c839 100644 --- a/pythonpro/promos/tests/test_views.py +++ b/pythonpro/promos/tests/test_views.py @@ -24,6 +24,8 @@ def test_ty_status(client): @pytest.mark.parametrize( 'content', [ + 'Motivação', + '

Motivação

', '
diff --git a/pythonpro/promos/tests/test_views.py b/pythonpro/promos/tests/test_views.py index 42a3c839..d50956ec 100644 --- a/pythonpro/promos/tests/test_views.py +++ b/pythonpro/promos/tests/test_views.py @@ -1,15 +1,22 @@ import pytest - from django.urls import reverse +from model_mommy import mommy + +from pythonpro.promos.models import Video @pytest.fixture -def video_resp(client, transactional_db): +def video_resp(client, video): return client.get( - reverse(viewname='promos:video', args=('motivacao',)), + reverse(viewname='promos:video', args=(video.slug,)), ) +@pytest.fixture +def video(transactional_db): + return mommy.make(Video) + + def test_video_status(video_resp): assert 200 == video_resp.status_code @@ -24,9 +31,6 @@ def test_ty_status(client): @pytest.mark.parametrize( 'content', [ - 'Motivação', - '

Motivação

', - '