-
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.
Showing
7 changed files
with
89 additions
and
2 deletions.
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 @@ | ||
# Generated by Django 5.0.4 on 2024-04-14 18:50 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('modulos', '0005_aula'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='aula', | ||
name='vimeo_id', | ||
field=models.CharField(default='1', max_length=32), | ||
), | ||
] |
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 @@ | ||
# Generated by Django 5.0.4 on 2024-04-14 18:50 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('modulos', '0006_aula_vimeo_id'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='aula', | ||
name='vimeo_id', | ||
field=models.CharField(max_length=32), | ||
), | ||
] |
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,15 @@ | ||
{% extends 'base/base.html' %} | ||
{% block title %}Python Pro - Aperitivo{% endblock title %} | ||
{% block description %}Página com vídeo gratuito de Python{% endblock description %} | ||
{% block body %} | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h1 class="mt-4 mb-3">{{ aula.titulo | default:'Faltando título' }}</h1> | ||
<iframe src="https://player.vimeo.com/video/{{ aula.vimeo_id }}" width="640" height="360" frameborder="0" | ||
allow="autoplay; fullscreen; picture-in-picture" allowfullscreen> | ||
</iframe> | ||
</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,30 @@ | ||
from django.urls import reverse | ||
import pytest | ||
from pypro.django_assertions import assert_contains | ||
from model_bakery import baker | ||
|
||
from pypro.modulos.models import Aula, Modulo | ||
|
||
|
||
@pytest.fixture | ||
def modulo(db): | ||
return baker.make(Modulo) | ||
|
||
|
||
@pytest.fixture | ||
def aula(modulo): | ||
return baker.make(Aula, modulo=modulo) | ||
|
||
|
||
@pytest.fixture | ||
def resp(client, aula): | ||
resp = client.get(reverse('modulos:aula', kwargs={'slug': aula.slug})) | ||
return resp | ||
|
||
|
||
def test_titulo(resp, aula: Aula): | ||
assert_contains(resp, aula.titulo) | ||
|
||
|
||
def test_vimeo(resp, aula: Aula): | ||
assert_contains(resp, f'src="https://player.vimeo.com/video/{ aula.vimeo_id }') |
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