Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Project1-Valenzuela-185143
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
Anton Ralph Valenzuela
Project1-Valenzuela-185143
Commits
f9222deb
Commit
f9222deb
authored
Mar 13, 2020
by
Anton Ralph F. Valenzuela
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added unit tests per view, including home page.
parent
d149e8fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
1 deletion
+63
-1
tests.py
froyo/tests.py
+63
-1
No files found.
froyo/tests.py
View file @
f9222deb
from
django.test
import
TestCase
from
django.test
import
TestCase
# Create your tests here.
class
HomePageTest
(
TestCase
):
def
test_home_uses_template
(
self
):
response
=
self
.
client
.
get
(
'/'
)
self
.
assertTemplateUsed
(
response
,
'home.html'
)
class
OrdersTest
(
TestCase
):
def
test_orders_use_list_template
(
self
):
response
=
self
.
client
.
get
(
'/orders/'
)
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'
)
self
.
assertTemplateUsed
(
response
,
'orders_update.html'
)
def
test_orders_use_create_form_template
(
self
):
response
=
self
.
client
.
get
(
'/orders/create'
)
self
.
assertTemplateUsed
(
response
,
'orders_create.html'
)
class
RecipesTest
(
TestCase
):
def
test_recipes_use_list_template
(
self
):
response
=
self
.
client
.
get
(
'/recipes/'
)
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'
)
self
.
assertTemplateUsed
(
response
,
'recipes_update.html'
)
def
test_recipes_use_create_form_template
(
self
):
response
=
self
.
client
.
get
(
'/recipes/create'
)
self
.
assertTemplateUsed
(
response
,
'recipes_create.html'
)
class
IngredientsTest
(
TestCase
):
def
test_ingredients_use_list_template
(
self
):
response
=
self
.
client
.
get
(
'/ingredients/'
)
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'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_update.html'
)
def
test_ingredients_use_create_form_template
(
self
):
response
=
self
.
client
.
get
(
'/ingredients/create'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_create.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