Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm-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
Abigail Moreno
midterm-thegoodplace
Commits
a17afee6
Commit
a17afee6
authored
Mar 18, 2020
by
abbeeeeyyyyy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the tests file
parent
4030f9e9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
35 deletions
+39
-35
tests.py
froyo/tests.py
+37
-33
urls.py
froyo/urls.py
+2
-2
No files found.
froyo/tests.py
View file @
a17afee6
...
@@ -26,50 +26,54 @@ from django.template.loader import render_to_string
...
@@ -26,50 +26,54 @@ from django.template.loader import render_to_string
# Create your tests here.
# Create your tests here.
class
TheGoodPlaceSiteTest
(
TestCase
):
class
TheGoodPlaceSiteTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/
heroes
/'
)
response
=
self
.
client
.
get
(
'/
froyo
/'
)
self
.
assertTemplateUsed
(
response
,
'
heroes
.html'
)
self
.
assertTemplateUsed
(
response
,
'
froyo
.html'
)
def
test_ingredients_list_page_returns_correct_html
(
self
):
def
test_ingredients_list_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
/hero/jester
/'
)
response
=
self
.
client
.
get
(
'
froyo/ingredients/list
/'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_list.html'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_list.html'
)
def
test_
cloud
_page_returns_correct_html
(
self
):
def
test_
ingredients_detail
_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
/hero/cloud
/'
)
response
=
self
.
client
.
get
(
'
froyo/ingredients/detail
/'
)
self
.
assertTemplateUsed
(
response
,
'
detail_cloud
.html'
)
self
.
assertTemplateUsed
(
response
,
'
ingredients_detail
.html'
)
def
test_
sunflowey
_page_returns_correct_html
(
self
):
def
test_
ingredients_update
_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
/hero/sunflowey
/'
)
response
=
self
.
client
.
get
(
'
froyo/ingredients/update
/'
)
self
.
assertTemplateUsed
(
response
,
'
detail_sunflowey
.html'
)
self
.
assertTemplateUsed
(
response
,
'
ingredients_update_form
.html'
)
def
test_
hom
e_page_returns_correct_html
(
self
):
def
test_
ingredients_creat
e_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
/heroes
/'
)
response
=
self
.
client
.
get
(
'
froyo/ingredients/create
/'
)
self
.
assertTemplateUsed
(
response
,
'
heroes
.html'
)
self
.
assertTemplateUsed
(
response
,
'
ingredients_create_form
.html'
)
def
test_
jester
_page_returns_correct_html
(
self
):
def
test_
recipe_list
_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
/hero/jester
/'
)
response
=
self
.
client
.
get
(
'
froyo/recipes/list
/'
)
self
.
assertTemplateUsed
(
response
,
'
detail_jester
.html'
)
self
.
assertTemplateUsed
(
response
,
'
recipe_list
.html'
)
def
test_
cloud
_page_returns_correct_html
(
self
):
def
test_
recipe_detail
_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
/hero/cloud
/'
)
response
=
self
.
client
.
get
(
'
froyo/recipes/detail
/'
)
self
.
assertTemplateUsed
(
response
,
'
detail_cloud
.html'
)
self
.
assertTemplateUsed
(
response
,
'
recipes_detail
.html'
)
def
test_
sunflowey
_page_returns_correct_html
(
self
):
def
test_
recipe_update
_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
/hero/sunflowey
/'
)
response
=
self
.
client
.
get
(
'
froyo/recipes/update
/'
)
self
.
assertTemplateUsed
(
response
,
'
detail_sunflowey
.html'
)
self
.
assertTemplateUsed
(
response
,
'
recipes_update_form
.html'
)
def
test_home_page_returns_correct_html
(
self
):
def
test_recipe_create_form_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/heroes/'
)
response
=
self
.
client
.
get
(
'froyo/recipes/create/'
)
self
.
assertTemplateUsed
(
response
,
'heroes.html'
)
self
.
assertTemplateUsed
(
response
,
'recipes_create_form.html'
)
def
test_orders_list_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'froyo/orders/list/'
)
self
.
assertTemplateUsed
(
response
,
'orders_list.html'
)
def
test_
jester
_page_returns_correct_html
(
self
):
def
test_
orders_detail
_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
/hero/jester
/'
)
response
=
self
.
client
.
get
(
'
froyo/orders/detail
/'
)
self
.
assertTemplateUsed
(
response
,
'detail_jester
.html'
)
self
.
assertTemplateUsed
(
response
,
'orders_detail
.html'
)
def
test_
cloud
_page_returns_correct_html
(
self
):
def
test_
orders_update_form
_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
/hero/cloud
/'
)
response
=
self
.
client
.
get
(
'
froyo/orders/update
/'
)
self
.
assertTemplateUsed
(
response
,
'
detail_cloud
.html'
)
self
.
assertTemplateUsed
(
response
,
'
orders_update_form
.html'
)
def
test_
sunflowey
_page_returns_correct_html
(
self
):
def
test_
orders_create_form
_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
/hero/sunflowey
/'
)
response
=
self
.
client
.
get
(
'
froyo/orders/create
/'
)
self
.
assertTemplateUsed
(
response
,
'
detail_sunflowey
.html'
)
self
.
assertTemplateUsed
(
response
,
'
orders_create_form
.html'
)
froyo/urls.py
View file @
a17afee6
...
@@ -20,8 +20,8 @@ from .views import Orders_CreateFormView
...
@@ -20,8 +20,8 @@ from .views import Orders_CreateFormView
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
HeroesView
.
as_view
(),
name
=
'
heroes
'
),
path
(
''
,
HeroesView
.
as_view
(),
name
=
'
froyo
'
),
path
(
'
heroes
/'
,
HeroesView
.
as_view
(),
name
=
'heroes'
),
path
(
'
froyo
/'
,
HeroesView
.
as_view
(),
name
=
'heroes'
),
path
(
'froyo/ingredients/list/'
,
Ingredients_ListView
.
as_view
(),
name
=
'ingredients_list'
),
path
(
'froyo/ingredients/list/'
,
Ingredients_ListView
.
as_view
(),
name
=
'ingredients_list'
),
path
(
'froyo/ingredients/detail/'
,
Ingredients_DetailView
.
as_view
(),
name
=
'ingredients_detail'
),
path
(
'froyo/ingredients/detail/'
,
Ingredients_DetailView
.
as_view
(),
name
=
'ingredients_detail'
),
...
...
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