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
36dad994
Commit
36dad994
authored
Mar 21, 2020
by
John Carlos Sanil
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'recipes-branch' into 'develop'
United Tested and Created Recipes Views See merge request
!7
parents
907b44ab
5b024f62
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
4 deletions
+76
-4
recipes_create_form.html
froyo/templates/recipes_create_form.html
+8
-0
recipes_detail.html
froyo/templates/recipes_detail.html
+8
-0
recipes_list.html
froyo/templates/recipes_list.html
+8
-0
recipes_update_form.html
froyo/templates/recipes_update_form.html
+8
-0
tests.py
froyo/tests.py
+20
-1
urls.py
froyo/urls.py
+9
-2
views.py
froyo/views.py
+15
-1
No files found.
froyo/templates/recipes_create_form.html
0 → 100644
View file @
36dad994
<html>
<head>
<title>
Recipes - Create
</title>
</head>
<body>
<h1>
Recipes - Create
</h1>
</body>
</html>
froyo/templates/recipes_detail.html
0 → 100644
View file @
36dad994
<html>
<head>
<title>
Recipes - Detail
</title>
</head>
<body>
<h1>
Recipes - Detail
</h1>
</body>
</html>
froyo/templates/recipes_list.html
0 → 100644
View file @
36dad994
<html>
<head>
<title>
Recipes - List
</title>
</head>
<body>
<h1>
Recipes - List
</h1>
</body>
</html>
froyo/templates/recipes_update_form.html
0 → 100644
View file @
36dad994
<html>
<head>
<title>
Recipes - Update
</title>
</head>
<body>
<h1>
Recipes - Update
</h1>
</body>
</html>
froyo/tests.py
View file @
36dad994
...
@@ -26,3 +26,22 @@ class IngredientsPageTests(TestCase):
...
@@ -26,3 +26,22 @@ class IngredientsPageTests(TestCase):
def
test_ingredients_create_returns_correct_html
(
self
):
def
test_ingredients_create_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/ingredients_create_form'
)
response
=
self
.
client
.
get
(
'/ingredients_create_form'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_create_form.html'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_create_form.html'
)
class
RecipesPageTests
(
TestCase
):
def
test_recipes_list_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/recipes_list'
)
self
.
assertTemplateUsed
(
response
,
'recipes_list.html'
)
def
test_recipes_detail_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/recipes_detail'
)
self
.
assertTemplateUsed
(
response
,
'recipes_detail.html'
)
def
test_recipes_update_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/recipes_update_form'
)
self
.
assertTemplateUsed
(
response
,
'recipes_update_form.html'
)
def
test_recipes_create_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/recipes_create_form'
)
self
.
assertTemplateUsed
(
response
,
'recipes_create_form.html'
)
\ No newline at end of file
froyo/urls.py
View file @
36dad994
from
django.conf.urls
import
url
from
django.conf.urls
import
url
from
.views
import
HomePageView
,
IngredientsListView
,
IngredientsDetailView
,
IngredientsUpdateView
,
IngredientsCreateView
from
.views
import
HomePageView
from
.views
import
IngredientsListView
,
IngredientsDetailView
,
IngredientsUpdateView
,
IngredientsCreateView
from
.views
import
RecipesListView
,
RecipesDetailView
,
RecipesUpdateView
,
RecipesCreateView
urlpatterns
=
[
urlpatterns
=
[
...
@@ -8,5 +10,10 @@ urlpatterns = [
...
@@ -8,5 +10,10 @@ urlpatterns = [
url
(
r'^ingredients_list$'
,
IngredientsListView
.
as_view
(),
name
=
'ingredients_list'
),
url
(
r'^ingredients_list$'
,
IngredientsListView
.
as_view
(),
name
=
'ingredients_list'
),
url
(
r'^ingredients_detail$'
,
IngredientsDetailView
.
as_view
(),
name
=
'ingredients_detail'
),
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_update_form$'
,
IngredientsUpdateView
.
as_view
(),
name
=
'ingredients_update_form'
),
url
(
r'^ingredients_create_form$'
,
IngredientsCreateView
.
as_view
(),
name
=
'ingredients_create_form'
)
url
(
r'^ingredients_create_form$'
,
IngredientsCreateView
.
as_view
(),
name
=
'ingredients_create_form'
),
url
(
r'^recipes_list$'
,
RecipesListView
.
as_view
(),
name
=
'recipes_list'
),
url
(
r'^recipes_detail$'
,
RecipesDetailView
.
as_view
(),
name
=
'recipes_detail'
),
url
(
r'^recipes_update_form$'
,
RecipesUpdateView
.
as_view
(),
name
=
'recipes_update_form'
),
url
(
r'^recipes_create_form$'
,
RecipesCreateView
.
as_view
(),
name
=
'recipes_create_form'
)
]
]
\ No newline at end of file
froyo/views.py
View file @
36dad994
...
@@ -7,6 +7,7 @@ from django.views.generic.base import TemplateView
...
@@ -7,6 +7,7 @@ from django.views.generic.base import TemplateView
class
HomePageView
(
TemplateView
):
class
HomePageView
(
TemplateView
):
template_name
=
"home.html"
template_name
=
"home.html"
class
IngredientsListView
(
TemplateView
):
class
IngredientsListView
(
TemplateView
):
template_name
=
"ingredients_list.html"
template_name
=
"ingredients_list.html"
...
@@ -18,3 +19,16 @@ class IngredientsUpdateView(TemplateView):
...
@@ -18,3 +19,16 @@ class IngredientsUpdateView(TemplateView):
class
IngredientsCreateView
(
TemplateView
):
class
IngredientsCreateView
(
TemplateView
):
template_name
=
"ingredients_create_form.html"
template_name
=
"ingredients_create_form.html"
class
RecipesListView
(
TemplateView
):
template_name
=
"recipes_list.html"
class
RecipesDetailView
(
TemplateView
):
template_name
=
"recipes_detail.html"
class
RecipesUpdateView
(
TemplateView
):
template_name
=
"recipes_update_form.html"
class
RecipesCreateView
(
TemplateView
):
template_name
=
"recipes_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