Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thegoodplace
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
Karlo Cabugwang
thegoodplace
Commits
6691cc99
Commit
6691cc99
authored
Mar 18, 2020
by
Karlo Cabugwang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed to templateview and all tests passed
parent
2b928581
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
20 deletions
+61
-20
tests.py
froyo/tests.py
+43
-1
urls.py
froyo/urls.py
+4
-4
views.py
froyo/views.py
+14
-15
No files found.
froyo/tests.py
View file @
6691cc99
...
...
@@ -21,3 +21,45 @@ class IngredientsUpdateViewTest(TestCase):
def
test_can_open_ingredients_update_view_temp
(
self
):
response
=
self
.
client
.
get
(
'/ingredients/update'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_update_form.html'
)
class
OrdersListViewTest
(
TestCase
):
def
test_can_open_orders_list_view_temp
(
self
):
response
=
self
.
client
.
get
(
'/orders'
)
self
.
assertTemplateUsed
(
response
,
'orders_list.html'
)
class
OrdersDetailViewTest
(
TestCase
):
def
test_can_open_orders_detail_view_temp
(
self
):
response
=
self
.
client
.
get
(
'/orders/detail'
)
self
.
assertTemplateUsed
(
response
,
'orders_detail.html'
)
class
OrdersCreateViewTest
(
TestCase
):
def
test_can_open_orders_create_view_temp
(
self
):
response
=
self
.
client
.
get
(
'/orders/new'
)
self
.
assertTemplateUsed
(
response
,
'orders_create_form.html'
)
class
OrdersUpdateViewTest
(
TestCase
):
def
test_can_open_orders_update_view_temp
(
self
):
response
=
self
.
client
.
get
(
'/orders/update'
)
self
.
assertTemplateUsed
(
response
,
'orders_update_form.html'
)
class
RecipesListViewTest
(
TestCase
):
def
test_can_open_recipes_list_view_temp
(
self
):
response
=
self
.
client
.
get
(
'/recipes'
)
self
.
assertTemplateUsed
(
response
,
'recipes_list.html'
)
class
RecipesDetailViewTest
(
TestCase
):
def
test_can_open_recipes_detail_view_temp
(
self
):
response
=
self
.
client
.
get
(
'/recipes/detail'
)
self
.
assertTemplateUsed
(
response
,
'recipes_detail.html'
)
class
RecipesCreateViewTest
(
TestCase
):
def
test_can_open_recipes_create_view_temp
(
self
):
response
=
self
.
client
.
get
(
'/recipes/new'
)
self
.
assertTemplateUsed
(
response
,
'recipes_create_form.html'
)
class
RecipesUpdateViewTest
(
TestCase
):
def
test_can_open_recipes_update_view_temp
(
self
):
response
=
self
.
client
.
get
(
'/recipes/update'
)
self
.
assertTemplateUsed
(
response
,
'recipes_update_form.html'
)
\ No newline at end of file
froyo/urls.py
View file @
6691cc99
...
...
@@ -14,8 +14,8 @@ urlpatterns = [
url
(
r'^orders/new$'
,
OrdersCreateView
.
as_view
(),
name
=
'orders_create'
),
url
(
r'^orders/update$'
,
OrdersUpdateView
.
as_view
(),
name
=
'orders_update'
),
url
(
r'^recipes$'
,
Ingredient
sListView
.
as_view
(),
name
=
'recipes_list'
),
url
(
r'^recipes/detail$'
,
Ingredient
sDetailView
.
as_view
(),
name
=
'recipes_detail'
),
url
(
r'^recipes/new$'
,
Ingredient
sCreateView
.
as_view
(),
name
=
'recipes_create'
),
url
(
r'^recipes/update$'
,
Ingredient
sUpdateView
.
as_view
(),
name
=
'recipes_update'
),
url
(
r'^recipes$'
,
Recipe
sListView
.
as_view
(),
name
=
'recipes_list'
),
url
(
r'^recipes/detail$'
,
Recipe
sDetailView
.
as_view
(),
name
=
'recipes_detail'
),
url
(
r'^recipes/new$'
,
Recipe
sCreateView
.
as_view
(),
name
=
'recipes_create'
),
url
(
r'^recipes/update$'
,
Recipe
sUpdateView
.
as_view
(),
name
=
'recipes_update'
),
]
\ No newline at end of file
froyo/views.py
View file @
6691cc99
from
django.views.generic.base
import
TemplateView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.list
import
ListView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.models
import
*
class
IngredientsListView
(
ListView
):
class
IngredientsListView
(
TemplateView
):
template_name
=
"ingredients_list.html"
class
IngredientsDetailView
(
Detail
View
):
class
IngredientsDetailView
(
Template
View
):
template_name
=
"ingredients_detail.html"
class
IngredientsCreateView
(
Cre
ateView
):
class
IngredientsCreateView
(
Templ
ateView
):
template_name
=
"ingredients_create_form.html"
class
IngredientsUpdateView
(
Upd
ateView
):
class
IngredientsUpdateView
(
Templ
ateView
):
template_name
=
"ingredients_update_form.html"
class
OrdersListView
(
List
View
):
class
OrdersListView
(
Template
View
):
template_name
=
"orders_list.html"
class
OrdersDetailView
(
Detail
View
):
class
OrdersDetailView
(
Template
View
):
template_name
=
"orders_detail.html"
class
OrdersCreateView
(
Cre
ateView
):
class
OrdersCreateView
(
Templ
ateView
):
template_name
=
"orders_create_form.html"
class
OrdersUpdateView
(
Upd
ateView
):
class
OrdersUpdateView
(
Templ
ateView
):
template_name
=
"orders_update_form.html"
class
RecipesListView
(
List
View
):
class
RecipesListView
(
Template
View
):
template_name
=
"recipes_list.html"
class
RecipesDetailView
(
Detail
View
):
class
RecipesDetailView
(
Template
View
):
template_name
=
"recipes_detail.html"
class
RecipesCreateView
(
Cre
ateView
):
class
RecipesCreateView
(
Templ
ateView
):
template_name
=
"recipes_create_form.html"
class
RecipesUpdateView
(
Upd
ateView
):
class
RecipesUpdateView
(
Templ
ateView
):
template_name
=
"recipes_update_form.html"
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