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
4030f9e9
Commit
4030f9e9
authored
Mar 18, 2020
by
abbeeeeyyyyy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the froyo urls
parent
155b0a7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
14 deletions
+86
-14
tests.py
froyo/tests.py
+72
-0
urls.py
froyo/urls.py
+14
-14
No files found.
froyo/tests.py
View file @
4030f9e9
from
django.test
import
TestCase
from
django.urls
import
resolve
from
django.http
import
HttpRequest
from
.views
import
Ingredients_ListView
from
.views
import
Ingredients_DetailView
from
.views
import
Ingredients_UpdateFormView
from
.views
import
Ingredients_CreateFormView
from
.views
import
Recipes_ListView
from
.views
import
Recipes_DetailView
from
.views
import
Recipes_UpdateFormView
from
.views
import
Recipes_CreateFormView
from
.views
import
Orders_ListView
from
.views
import
Orders_DetailView
from
.views
import
Orders_UpdateFormView
from
.views
import
Orders_CreateFormView
from
django.template.loader
import
render_to_string
# Create your tests here.
class
TheGoodPlaceSiteTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/heroes/'
)
self
.
assertTemplateUsed
(
response
,
'heroes.html'
)
def
test_ingredients_list_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/jester/'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_list.html'
)
def
test_cloud_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/cloud/'
)
self
.
assertTemplateUsed
(
response
,
'detail_cloud.html'
)
def
test_sunflowey_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/sunflowey/'
)
self
.
assertTemplateUsed
(
response
,
'detail_sunflowey.html'
)
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/heroes/'
)
self
.
assertTemplateUsed
(
response
,
'heroes.html'
)
def
test_jester_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/jester/'
)
self
.
assertTemplateUsed
(
response
,
'detail_jester.html'
)
def
test_cloud_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/cloud/'
)
self
.
assertTemplateUsed
(
response
,
'detail_cloud.html'
)
def
test_sunflowey_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/sunflowey/'
)
self
.
assertTemplateUsed
(
response
,
'detail_sunflowey.html'
)
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/heroes/'
)
self
.
assertTemplateUsed
(
response
,
'heroes.html'
)
def
test_jester_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/jester/'
)
self
.
assertTemplateUsed
(
response
,
'detail_jester.html'
)
def
test_cloud_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/cloud/'
)
self
.
assertTemplateUsed
(
response
,
'detail_cloud.html'
)
def
test_sunflowey_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/sunflowey/'
)
self
.
assertTemplateUsed
(
response
,
'detail_sunflowey.html'
)
froyo/urls.py
View file @
4030f9e9
...
...
@@ -23,18 +23,18 @@ urlpatterns = [
path
(
''
,
HeroesView
.
as_view
(),
name
=
'heroes'
),
path
(
'heroes/'
,
HeroesView
.
as_view
(),
name
=
'heroes'
),
path
(
'
TheGoodPlace/Ingredients/L
ist/'
,
Ingredients_ListView
.
as_view
(),
name
=
'ingredients_list'
),
path
(
'
TheGoodPlace/Ingredients/D
etail/'
,
Ingredients_DetailView
.
as_view
(),
name
=
'ingredients_detail'
),
path
(
'
TheGoodPlace/Ingredients/UpdateForm
/'
,
Ingredients_UpdateFormView
.
as_view
(),
name
=
'ingredients_update_form'
),
path
(
'
TheGoodPlace/Ingredients/CreateForm
/'
,
Ingredients_CreateFormView
.
as_view
(),
name
=
'ingredients_create_form'
),
path
(
'
TheGoodPlace/Recipes/L
ist/'
,
Recipes_ListView
.
as_view
(),
name
=
'recipes_list'
),
path
(
'
TheGoodPlace/Recipes/D
etail/'
,
Recipes_DetailView
.
as_view
(),
name
=
'recipes_detail'
),
path
(
'
TheGoodPlace/Recipes/UpdateForm
/'
,
Recipes_UpdateFormView
.
as_view
(),
name
=
'recipes_update_form'
),
path
(
'
TheGoodPlace/Recipes/CreateForm
/'
,
Recipes_CreateFormView
.
as_view
(),
name
=
'recipes_create_form'
),
path
(
'
TheGoodPlace/Orders/List/'
,
Jester
View
.
as_view
(),
name
=
'orders_list'
),
path
(
'
TheGoodPlace/Orders/Detail/'
,
Sunflowey
View
.
as_view
(),
name
=
'orders_detail'
),
path
(
'
TheGoodPlace/Orders/UpdateForm/'
,
Cloud
View
.
as_view
(),
name
=
'orders_update_form'
),
path
(
'
TheGoodPlace/Orders/CreateForm/'
,
Heroes
View
.
as_view
(),
name
=
'orders_create_form'
),
path
(
'
froyo/ingredients/l
ist/'
,
Ingredients_ListView
.
as_view
(),
name
=
'ingredients_list'
),
path
(
'
froyo/ingredients/d
etail/'
,
Ingredients_DetailView
.
as_view
(),
name
=
'ingredients_detail'
),
path
(
'
froyo/ingredients/update
/'
,
Ingredients_UpdateFormView
.
as_view
(),
name
=
'ingredients_update_form'
),
path
(
'
froyo/ingredients/create
/'
,
Ingredients_CreateFormView
.
as_view
(),
name
=
'ingredients_create_form'
),
path
(
'
froyo/recipes/l
ist/'
,
Recipes_ListView
.
as_view
(),
name
=
'recipes_list'
),
path
(
'
froyo/recipes/d
etail/'
,
Recipes_DetailView
.
as_view
(),
name
=
'recipes_detail'
),
path
(
'
froyo/recipes/update
/'
,
Recipes_UpdateFormView
.
as_view
(),
name
=
'recipes_update_form'
),
path
(
'
froyo/recipes/create
/'
,
Recipes_CreateFormView
.
as_view
(),
name
=
'recipes_create_form'
),
path
(
'
froyo/orders/list/'
,
Orders_List
View
.
as_view
(),
name
=
'orders_list'
),
path
(
'
froyo/orders/detail/'
,
Orders_Detail
View
.
as_view
(),
name
=
'orders_detail'
),
path
(
'
froyo/orders/update/'
,
Orders_UpdateForm
View
.
as_view
(),
name
=
'orders_update_form'
),
path
(
'
froyo/orders/create/'
,
Orders_CreateForm
View
.
as_view
(),
name
=
'orders_create_form'
),
]
\ 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