Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thegoodplace-Laguesma
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
Cian Laguesma
thegoodplace-Laguesma
Commits
c01e69be
Commit
c01e69be
authored
Mar 21, 2020
by
cianlaguesma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed syntax
parent
f0b85398
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
27 deletions
+90
-27
tests.py
froyo/tests.py
+62
-0
urls.py
froyo/urls.py
+14
-14
views.py
froyo/views.py
+14
-13
No files found.
froyo/tests.py
View file @
c01e69be
from
django.test
import
TestCase
# Create your tests here.
class
HomeTest
(
TestCase
):
def
test_home_uses_template
(
self
):
response
=
self
.
client
.
get
(
'/index'
)
self
.
assertTemplateUsed
(
response
,
'index.html'
)
class
IngredientsTest
(
TestCase
):
def
test_ingredients_use_list_template
(
self
):
response
=
self
.
client
.
get
(
'/ingredients/list'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_list.html'
)
def
test_ingredients_use_detail_template
(
self
):
response
=
self
.
client
.
get
(
'/ingredients/detail'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_detail.html'
)
def
test_ingredients_use_update_form_template
(
self
):
response
=
self
.
client
.
get
(
'/ingredients/update_form'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_update_form.html'
)
def
test_ingredients_use_create_form_template
(
self
):
response
=
self
.
client
.
get
(
'/ingredients/create_form'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_create_form.html'
)
class
OrdersTest
(
TestCase
):
def
test_orders_use_list_template
(
self
):
response
=
self
.
client
.
get
(
'/orders/list'
)
self
.
assertTemplateUsed
(
response
,
'orders_list.html'
)
def
test_orders_use_detail_template
(
self
):
response
=
self
.
client
.
get
(
'/orders/detail'
)
self
.
assertTemplateUsed
(
response
,
'orders_detail.html'
)
def
test_orders_use_update_form_template
(
self
):
response
=
self
.
client
.
get
(
'/orders/update_form'
)
self
.
assertTemplateUsed
(
response
,
'orders_update_form.html'
)
def
test_orders_use_create_form_template
(
self
):
response
=
self
.
client
.
get
(
'/orders/create_form'
)
self
.
assertTemplateUsed
(
response
,
'orders_create_form.html'
)
class
RecipesTest
(
TestCase
):
def
test_recipes_use_list_template
(
self
):
response
=
self
.
client
.
get
(
'/recipes/list'
)
self
.
assertTemplateUsed
(
response
,
'recipes_list.html'
)
def
test_recipes_use_detail_template
(
self
):
response
=
self
.
client
.
get
(
'/recipes/detail'
)
self
.
assertTemplateUsed
(
response
,
'recipes_detail.html'
)
def
test_recipes_use_update_form_template
(
self
):
response
=
self
.
client
.
get
(
'/recipes/update_form'
)
self
.
assertTemplateUsed
(
response
,
'recipes_update_form.html'
)
def
test_recipes_use_create_form_template
(
self
):
response
=
self
.
client
.
get
(
'/recipes/create_form'
)
self
.
assertTemplateUsed
(
response
,
'recipes_create_form.html'
)
froyo/urls.py
View file @
c01e69be
from
django.conf.urls
import
url
from
.views
import
ingredients_list
,
ingredients_detail
,
ingredients_update_form
,
ingredients_create_form
,
recipes_list
,
recipes_detail
,
recipes_update_form
,
recipes_create_form
,
orders_list
,
orders_detail
,
orders_update_form
,
orders_create_form
,
home_page
from
.views
import
HomePage
,
IngredientsCreateForm
,
IngredientsDetail
,
IngredientsList
,
IngredientsUpdateForm
,
RecipesCreateForm
,
RecipesDetail
,
RecipesList
,
RecipesUpdateForm
,
OrdersCreateForm
,
OrdersDetail
,
OrdersList
,
OrdersUpdateForm
urlpatterns
=
[
url
(
r'^index$'
,
home_p
age
.
as_view
(),
name
=
'home_page'
),
url
(
r'^ingredients/list$'
,
ingredients_l
ist
.
as_view
(),
name
=
'ingredients_list'
),
url
(
r'^ingredients/detail$'
,
ingredients_d
etail
.
as_view
(),
name
=
'ingredients_detail'
),
url
(
r'^ingredients/update_form$'
,
ingredients_update_f
orm
.
as_view
(),
name
=
'ingredients_update_form'
),
url
(
r'^ingredients/create_form$'
,
ingredients_create_f
orm
.
as_view
(),
name
=
'ingredients_create_form'
),
url
(
r'^recipes/list$'
,
recipes_l
ist
.
as_view
(),
name
=
'recipes_list'
),
url
(
r'^recipes/detail$'
,
recipes_d
etail
.
as_view
(),
name
=
'recipes_detail'
),
url
(
r'^recipes/update_form$'
,
recipes_update_f
orm
.
as_view
(),
name
=
'recipes_update_form'
),
url
(
r'^recipes/create_form$'
,
recipes_create_f
orm
.
as_view
(),
name
=
'recipes_create_form'
),
url
(
r'^orders/list$'
,
orders_l
ist
.
as_view
(),
name
=
'orders_list'
),
url
(
r'^orders/detail$'
,
orders_d
etail
.
as_view
(),
name
=
'orders_detail'
),
url
(
r'^orders/update_form$'
,
orders_update_f
orm
.
as_view
(),
name
=
'orders_update_form'
),
url
(
r'^orders/create_form$'
,
orders_create_f
orm
.
as_view
(),
name
=
'recipes_create_form'
),
url
(
r'^index$'
,
HomeP
age
.
as_view
(),
name
=
'home_page'
),
url
(
r'^ingredients/list$'
,
IngredientsL
ist
.
as_view
(),
name
=
'ingredients_list'
),
url
(
r'^ingredients/detail$'
,
IngredientsD
etail
.
as_view
(),
name
=
'ingredients_detail'
),
url
(
r'^ingredients/update_form$'
,
IngredientsUpdateF
orm
.
as_view
(),
name
=
'ingredients_update_form'
),
url
(
r'^ingredients/create_form$'
,
IngredientsCreateF
orm
.
as_view
(),
name
=
'ingredients_create_form'
),
url
(
r'^recipes/list$'
,
RecipesL
ist
.
as_view
(),
name
=
'recipes_list'
),
url
(
r'^recipes/detail$'
,
RecipesD
etail
.
as_view
(),
name
=
'recipes_detail'
),
url
(
r'^recipes/update_form$'
,
RecipesUpdateF
orm
.
as_view
(),
name
=
'recipes_update_form'
),
url
(
r'^recipes/create_form$'
,
RecipesCreateF
orm
.
as_view
(),
name
=
'recipes_create_form'
),
url
(
r'^orders/list$'
,
OrdersL
ist
.
as_view
(),
name
=
'orders_list'
),
url
(
r'^orders/detail$'
,
OrdersD
etail
.
as_view
(),
name
=
'orders_detail'
),
url
(
r'^orders/update_form$'
,
OrdersUpdateF
orm
.
as_view
(),
name
=
'orders_update_form'
),
url
(
r'^orders/create_form$'
,
OrdersCreateF
orm
.
as_view
(),
name
=
'recipes_create_form'
),
]
froyo/views.py
View file @
c01e69be
from
django.views.generic.base
import
TemplateView
from
django.views.generic.edit
import
CreateView
class
home_p
age
(
TemplateView
):
class
HomeP
age
(
TemplateView
):
template_name
=
'index.html'
class
ingredients_l
ist
(
TemplateView
):
class
IngredientsL
ist
(
TemplateView
):
template_name
=
'ingredients_list.html'
class
ingredients_d
etail
(
TemplateView
):
class
IngredientsD
etail
(
TemplateView
):
template_name
=
'ingredients_detail.html'
class
ingredients_update_f
orm
(
TemplateView
):
class
IngredientsUpdateF
orm
(
TemplateView
):
template_name
=
'ingredients_update_form.html'
class
ingredients_create_f
orm
(
TemplateView
):
class
IngredientsCreateF
orm
(
TemplateView
):
template_name
=
'ingredients_create_form.html'
class
recipes_l
ist
(
TemplateView
):
class
RecipesL
ist
(
TemplateView
):
template_name
=
'recipes_list.html'
class
recipes_d
etail
(
TemplateView
):
class
RecipesD
etail
(
TemplateView
):
template_name
=
'recipes_detail.html'
class
recipes_update_f
orm
(
TemplateView
):
class
RecipesUpdateF
orm
(
TemplateView
):
template_name
=
'recipes_update_form.html'
class
recipes_create_f
orm
(
TemplateView
):
class
RecipesCreateF
orm
(
TemplateView
):
template_name
=
'recipes_create_form.html'
class
orders_l
ist
(
TemplateView
):
class
OrdersL
ist
(
TemplateView
):
template_name
=
'orders_list.html'
class
orders_d
etail
(
TemplateView
):
class
OrdersD
etail
(
TemplateView
):
template_name
=
'orders_detail.html'
class
orders_update_f
orm
(
TemplateView
):
class
OrdersUpdateF
orm
(
TemplateView
):
template_name
=
'orders_update_form.html'
class
orders_create_f
orm
(
TemplateView
):
class
OrdersCreateF
orm
(
TemplateView
):
template_name
=
'orders_create_form.html'
# Create your views here.
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