forked from Sonar-Demos/python-flask-demo
-
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.
- Loading branch information
1 parent
77ee7e1
commit 9b4bd66
Showing
7 changed files
with
64 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
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,16 @@ | ||
{% extends "base.html" %} | ||
{% block styles %} | ||
{{ super() }} | ||
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static', filename='css/style.css') }}"> | ||
{% endblock %} | ||
{% block content %} | ||
<div class="full-page d-flex flex-wrap justify-content-center align-items-center"> | ||
<div class="container d-flex flex-column flex-wrap justify-content-start align-items-center text-center py-5 m-auto margin-mobile"> | ||
<h1>{{ name }} # {% autoescape false %} {{ pokemon_id }} {% endautoescape %}</h1> | ||
<div class="flex-row container d-flex flex-wrap justify-content-center align-items-center text-center mt-2"> | ||
<img src="{{ sprites[0] }}" alt=""> | ||
</div> | ||
<p>{{ description }}</p> | ||
</div> | ||
</div> | ||
{% endblock %} |
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,2 @@ | ||
def is_pikachu(pokemon_id, pokemon_name): | ||
return pokemon_id == 25 and pokemon_name == "Pikachu" |
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 |
---|---|---|
|
@@ -7,3 +7,9 @@ def test_index(client): | |
def test_subscribe(client): | ||
response = client.post("/subscribe", data={"email": "[email protected]"}) | ||
assert response.status_code == 302 | ||
|
||
|
||
def test_pokemon(client): | ||
response = client.get("/42") | ||
assert response.status_code == 200 | ||
assert b"MockDescription" in response.data |
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