Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CSCI40Lab1
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
Xavier Calabia
CSCI40Lab1
Commits
862f75e2
Commit
862f75e2
authored
Mar 10, 2020
by
Xavier Calabia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finished all tests, attempted to manage static files
parent
dec64e5d
Pipeline
#958
failed with stages
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
5 deletions
+21
-5
detail_cloud.html
heroes/templates/hero/detail_cloud.html
+2
-1
tests.py
heroes/tests.py
+13
-1
views.py
heroes/views.py
+2
-2
settings.py
willowisp/willowisp/settings.py
+4
-1
No files found.
heroes/templates/hero/detail_cloud.html
View file @
862f75e2
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
<title>
Detail - Cloud
</title>
<title>
Detail - Cloud
</title>
</head>
</head>
<body>
<body>
<img
src=
"./cloud.png"
style=
"width: 10vw;"
/>
{% load staticfiles %}
<img
src=
"{% static 'hero/cloud.png' %}"
style=
"width: 10vw;"
/>
<h1>
Detail - Cloud
</h1>
<h1>
Detail - Cloud
</h1>
<dl>
<dl>
<dt>
Health Points
</dt><dd>
600
</dd>
<dt>
Health Points
</dt><dd>
600
</dd>
...
...
heroes/tests.py
View file @
862f75e2
...
@@ -5,4 +5,16 @@ from django.test import TestCase
...
@@ -5,4 +5,16 @@ from django.test import TestCase
class
HomePageTest
(
TestCase
):
class
HomePageTest
(
TestCase
):
def
test_redirects_to_heros_template
(
self
):
def
test_redirects_to_heros_template
(
self
):
response
=
self
.
client
.
get
(
''
)
response
=
self
.
client
.
get
(
''
)
self
.
assertRedirects
(
response
,
'/heroes'
)
self
.
assertRedirects
(
response
,
'/heroes'
,
status_code
=
301
)
def
test_heroes_page_uses_heroes_template
(
self
):
response
=
self
.
client
.
get
(
'/heroes'
)
self
.
assertTemplateUsed
(
response
,
'heroes.html'
)
def
test_hero_detail_pages_use_hero_templates
(
self
):
response
=
self
.
client
.
get
(
'/hero/cloud'
)
self
.
assertTemplateUsed
(
response
,
'hero/detail_cloud.html'
)
response
=
self
.
client
.
get
(
'/hero/sunflowey'
)
self
.
assertTemplateUsed
(
response
,
'hero/detail_sunflowey.html'
)
response
=
self
.
client
.
get
(
'/hero/jester'
)
self
.
assertTemplateUsed
(
response
,
'hero/detail_jester.html'
)
heroes/views.py
View file @
862f75e2
...
@@ -5,8 +5,8 @@ def heroes_page(request):
...
@@ -5,8 +5,8 @@ def heroes_page(request):
return
render
(
request
,
'heroes.html'
)
return
render
(
request
,
'heroes.html'
)
def
redirect_to_heroes_page
(
request
):
def
redirect_to_heroes_page
(
request
):
return
redirect
(
'/heroes'
)
return
redirect
(
'/heroes'
,
permanent
=
True
)
def
cloud_info_page
(
request
):
def
cloud_info_page
(
request
):
return
render
(
request
,
'hero/detail_cloud.html'
)
return
render
(
request
,
'hero/detail_cloud.html'
)
...
...
willowisp/willowisp/settings.py
View file @
862f75e2
...
@@ -122,4 +122,7 @@ USE_TZ = True
...
@@ -122,4 +122,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
# https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL
=
'/static/'
STATIC_URL
=
'templates/'
STATICFILES_DIRS
=
[
os
.
path
.
join
(
BASE_DIR
,
"templates"
),
]
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