Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
willowisp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jesus Alvaro C. Pato
willowisp
Commits
a99017fd
Commit
a99017fd
authored
Mar 10, 2020
by
Jesus Alvaro C. Pato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created and unit tested functions to render HTML templates
parent
6d1a3ae5
Pipeline
#938
failed with stages
Changes
13
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
53 additions
and
2 deletions
+53
-2
gitignore
gitignore
+1
-0
cloud.png
heroes/templates/cloud.png
+0
-0
detail_cloud.html
heroes/templates/detail_cloud.html
+0
-0
detail_heroes.html
heroes/templates/detail_heroes.html
+3
-0
detail_jester.html
heroes/templates/detail_jester.html
+0
-0
detail_sunflowey.html
heroes/templates/detail_sunflowey.html
+0
-0
jester.png
heroes/templates/jester.png
+0
-0
sunflowey.png
heroes/templates/sunflowey.png
+0
-0
tests.py
heroes/tests.py
+23
-0
urls.py
heroes/urls.py
+11
-0
views.py
heroes/views.py
+12
-1
settings.py
willowisp/settings.py
+1
-0
urls.py
willowisp/urls.py
+2
-1
No files found.
gitignore
0 → 100644
View file @
a99017fd
*.pyc
h
tml
/cloud.png
→
h
eroes/templates
/cloud.png
View file @
a99017fd
File moved
h
tml
/detail_cloud.html
→
h
eroes/templates
/detail_cloud.html
View file @
a99017fd
File moved
heroes/templates/detail_heroes.html
0 → 100644
View file @
a99017fd
<!DOCTYPE html>
<html>
</html>
\ No newline at end of file
h
tml
/detail_jester.html
→
h
eroes/templates
/detail_jester.html
View file @
a99017fd
File moved
h
tml
/detail_sunflowey.html
→
h
eroes/templates
/detail_sunflowey.html
View file @
a99017fd
File moved
h
tml
/jester.png
→
h
eroes/templates
/jester.png
View file @
a99017fd
File moved
h
tml
/sunflowey.png
→
h
eroes/templates
/sunflowey.png
View file @
a99017fd
File moved
heroes/tests.py
View file @
a99017fd
from
django.urls
import
resolve
from
django.test
import
TestCase
from
django.test
import
TestCase
from
.views
import
HeroesView
,
HeroCloudView
,
HeroSunfloweyView
,
HeroJesterView
# Create your tests here.
# Create your tests here.
class
HeroesPageTest
(
TestCase
):
def
test_heroes_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/heroes'
)
self
.
assertTemplateUsed
(
response
,
'detail_heroes.html'
)
class
HeroCloudPageTest
(
TestCase
):
def
test_cloud_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/cloud'
)
self
.
assertTemplateUsed
(
response
,
'detail_cloud.html'
)
class
HeroSunfloweyPageTest
(
TestCase
):
def
test_sunflowey_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/sunflowey'
)
self
.
assertTemplateUsed
(
response
,
'detail_sunflowey.html'
)
class
HeroJesterPageTest
(
TestCase
):
def
test_jester_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/jester'
)
self
.
assertTemplateUsed
(
response
,
'detail_jester.html'
)
heroes/urls.py
0 → 100644
View file @
a99017fd
from
django.conf.urls
import
url
from
.views
import
HeroesView
,
HeroCloudView
,
HeroSunfloweyView
,
HeroJesterView
urlpatterns
=
[
url
(
r'^heroes$'
,
HeroesView
.
as_view
(),
name
=
'Heroes'
),
url
(
r'^hero/cloud$'
,
HeroCloudView
.
as_view
(),
name
=
'Cloud'
),
url
(
r'^hero/sunflowey$'
,
HeroSunfloweyView
.
as_view
(),
name
=
'Sunflowey'
),
url
(
r'^hero/jester$'
,
HeroJesterView
.
as_view
(),
name
=
'Jester'
),
]
heroes/views.py
View file @
a99017fd
from
django.
shortcuts
import
render
from
django.
views.generic.base
import
TemplateView
# Create your views here.
# Create your views here.
class
HeroesView
(
TemplateView
):
template_name
=
'detail_heroes.html'
class
HeroCloudView
(
TemplateView
):
template_name
=
'detail_cloud.html'
class
HeroSunfloweyView
(
TemplateView
):
template_name
=
'detail_sunflowey.html'
class
HeroJesterView
(
TemplateView
):
template_name
=
'detail_jester.html'
willowisp/settings.py
View file @
a99017fd
...
@@ -37,6 +37,7 @@ INSTALLED_APPS = [
...
@@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'django.contrib.staticfiles'
,
'heroes'
,
]
]
MIDDLEWARE
=
[
MIDDLEWARE
=
[
...
...
willowisp/urls.py
View file @
a99017fd
...
@@ -13,9 +13,10 @@ Including another URLconf
...
@@ -13,9 +13,10 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
"""
from
django.conf.urls
import
url
from
django.conf.urls
import
include
,
url
from
django.contrib
import
admin
from
django.contrib
import
admin
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^admin/'
,
admin
.
site
.
urls
),
url
(
r'^admin/'
,
admin
.
site
.
urls
),
url
(
r''
,
include
(
'heroes.urls'
)),
]
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment