Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
csci40_midterms
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
John Carlos Sanil
csci40_midterms
Commits
16d64c39
Commit
16d64c39
authored
Mar 21, 2020
by
Carlowsss
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unit Tested and Created Ingredients Views
parent
f742b982
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
3 deletions
+71
-3
home.html
froyo/templates/home.html
+3
-1
ingredients_create_form.html
froyo/templates/ingredients_create_form.html
+8
-0
ingredients_detail.html
froyo/templates/ingredients_detail.html
+8
-0
ingredients_list.html
froyo/templates/ingredients_list.html
+8
-0
ingredients_update_form.html
froyo/templates/ingredients_update_form.html
+8
-0
tests.py
froyo/tests.py
+18
-0
urls.py
froyo/urls.py
+5
-1
views.py
froyo/views.py
+13
-1
No files found.
froyo/templates/home.html
View file @
16d64c39
...
...
@@ -2,5 +2,7 @@
<head>
<title>
The Good Place FroYo Shop
</title>
</head>
<body>
<h1>
The Good Place FroYo Shop
</h1>
</body>
</html>
froyo/templates/ingredients_create_form.html
0 → 100644
View file @
16d64c39
<html>
<head>
<title>
Ingredients - Update
</title>
</head>
<body>
<h1>
Ingredients - Update
</h1>
</body>
</html>
froyo/templates/ingredients_detail.html
0 → 100644
View file @
16d64c39
<html>
<head>
<title>
Ingredients - Detail
</title>
</head>
<body>
<h1>
Ingredients - Detail
</h1>
</body>
</html>
froyo/templates/ingredients_list.html
0 → 100644
View file @
16d64c39
<html>
<head>
<title>
Ingredients - List
</title>
</head>
<body>
<h1>
Ingredients - List
</h1>
</body>
</html>
froyo/templates/ingredients_update_form.html
0 → 100644
View file @
16d64c39
<html>
<head>
<title>
Ingredients - Update
</title>
</head>
<body>
<h1>
Ingredients - Update
</h1>
</body>
</html>
froyo/tests.py
View file @
16d64c39
...
...
@@ -8,3 +8,21 @@ class HomePageTest(TestCase):
response
=
self
.
client
.
get
(
'/'
)
self
.
assertTemplateUsed
(
response
,
'home.html'
)
class
IngredientsPageTests
(
TestCase
):
def
test_ingredients_list_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/ingredients_list'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_list.html'
)
def
test_ingredients_detail_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/ingredients_detail'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_detail.html'
)
def
test_ingredients_update_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/ingredients_update_form'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_update_form.html'
)
def
test_ingredients_create_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/ingredients_create_form'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_create_form.html'
)
\ No newline at end of file
froyo/urls.py
View file @
16d64c39
from
django.conf.urls
import
url
from
.views
import
HomePageView
from
.views
import
HomePageView
,
IngredientsListView
,
IngredientsDetailView
,
IngredientsUpdateView
,
IngredientsCreateView
urlpatterns
=
[
url
(
r'^$'
,
HomePageView
.
as_view
(),
name
=
'home'
),
url
(
r'^ingredients_list$'
,
IngredientsListView
.
as_view
(),
name
=
'ingredients_list'
),
url
(
r'^ingredients_detail$'
,
IngredientsDetailView
.
as_view
(),
name
=
'ingredients_detail'
),
url
(
r'^ingredients_update_form$'
,
IngredientsUpdateView
.
as_view
(),
name
=
'ingredients_update_form'
),
url
(
r'^ingredients_create_form$'
,
IngredientsCreateView
.
as_view
(),
name
=
'ingredients_create_form'
)
]
\ No newline at end of file
froyo/views.py
View file @
16d64c39
...
...
@@ -6,3 +6,15 @@ from django.views.generic.base import TemplateView
class
HomePageView
(
TemplateView
):
template_name
=
"home.html"
class
IngredientsListView
(
TemplateView
):
template_name
=
"ingredients_list.html"
class
IngredientsDetailView
(
TemplateView
):
template_name
=
"ingredients_detail.html"
class
IngredientsUpdateView
(
TemplateView
):
template_name
=
"ingredients_update_form.html"
class
IngredientsCreateView
(
TemplateView
):
template_name
=
"ingredients_create_form.html"
\ No newline at end of file
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