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
709ea056
Commit
709ea056
authored
Mar 18, 2020
by
abbeeeeyyyyy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the assertionError. Templates are now rendered
parent
5bdeba94
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
38 deletions
+29
-38
tests.py
froyo/tests.py
+13
-17
urls.py
froyo/urls.py
+15
-18
views.py
froyo/views.py
+0
-2
settings.cpython-38.pyc
thegoodplace/__pycache__/settings.cpython-38.pyc
+0
-0
urls.cpython-38.pyc
thegoodplace/__pycache__/urls.cpython-38.pyc
+0
-0
settings.py
thegoodplace/settings.py
+1
-1
No files found.
froyo/tests.py
View file @
709ea056
...
...
@@ -2,7 +2,6 @@ from django.test import TestCase
from
django.urls
import
resolve
from
django.http
import
HttpRequest
from
.views
import
HomePage
from
.views
import
Ingredients_ListView
from
.views
import
Ingredients_DetailView
...
...
@@ -27,55 +26,52 @@ 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
(
'froyo/'
)
self
.
assertTemplateUsed
(
response
,
'froyo.html'
)
def
test_ingredients_list_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
froyo
/ingredients/list/'
)
response
=
self
.
client
.
get
(
'/ingredients/list/'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_list.html'
)
def
test_ingredients_detail_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
froyo
/ingredients/detail/'
)
response
=
self
.
client
.
get
(
'/ingredients/detail/'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_detail.html'
)
def
test_ingredients_update_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
froyo
/ingredients/update/'
)
response
=
self
.
client
.
get
(
'/ingredients/update/'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_update_form.html'
)
def
test_ingredients_create_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
froyo
/ingredients/create/'
)
response
=
self
.
client
.
get
(
'/ingredients/create/'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_create_form.html'
)
def
test_recipe_list_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
froyo
/recipes/list/'
)
self
.
assertTemplateUsed
(
response
,
'recipe_list.html'
)
response
=
self
.
client
.
get
(
'/recipes/list/'
)
self
.
assertTemplateUsed
(
response
,
'recipe
s
_list.html'
)
def
test_recipe_detail_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
froyo
/recipes/detail/'
)
response
=
self
.
client
.
get
(
'/recipes/detail/'
)
self
.
assertTemplateUsed
(
response
,
'recipes_detail.html'
)
def
test_recipe_update_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
froyo
/recipes/update/'
)
response
=
self
.
client
.
get
(
'/recipes/update/'
)
self
.
assertTemplateUsed
(
response
,
'recipes_update_form.html'
)
def
test_recipe_create_form_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
froyo
/recipes/create/'
)
response
=
self
.
client
.
get
(
'/recipes/create/'
)
self
.
assertTemplateUsed
(
response
,
'recipes_create_form.html'
)
def
test_orders_list_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
froyo
/orders/list/'
)
response
=
self
.
client
.
get
(
'/orders/list/'
)
self
.
assertTemplateUsed
(
response
,
'orders_list.html'
)
def
test_orders_detail_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
froyo
/orders/detail/'
)
response
=
self
.
client
.
get
(
'/orders/detail/'
)
self
.
assertTemplateUsed
(
response
,
'orders_detail.html'
)
def
test_orders_update_form_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
froyo
/orders/update/'
)
response
=
self
.
client
.
get
(
'/orders/update/'
)
self
.
assertTemplateUsed
(
response
,
'orders_update_form.html'
)
def
test_orders_create_form_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'
froyo
/orders/create/'
)
response
=
self
.
client
.
get
(
'/orders/create/'
)
self
.
assertTemplateUsed
(
response
,
'orders_create_form.html'
)
froyo/urls.py
View file @
709ea056
from
django.urls
import
path
from
django.contrib
import
admin
from
.views
import
HomePage
from
.views
import
Ingredients_ListView
from
.views
import
Ingredients_DetailView
...
...
@@ -22,21 +21,19 @@ from .views import Orders_CreateFormView
urlpatterns
=
[
path
(
''
,
HomePage
.
as_view
(),
name
=
'froyo'
),
path
(
'froyo/'
,
HomePage
.
as_view
(),
name
=
'froyo'
),
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/update/'
,
Ingredients_UpdateFormView
.
as_view
(),
name
=
'ingredients_update_form'
),
path
(
'froyo/ingredients/create/'
,
Ingredients_CreateFormView
.
as_view
(),
name
=
'ingredients_create_form'
),
path
(
'froyo/recipes/list/'
,
Recipes_ListView
.
as_view
(),
name
=
'recipes_list'
),
path
(
'froyo/recipes/detail/'
,
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_ListView
.
as_view
(),
name
=
'orders_list'
),
path
(
'froyo/orders/detail/'
,
Orders_DetailView
.
as_view
(),
name
=
'orders_detail'
),
path
(
'froyo/orders/update/'
,
Orders_UpdateFormView
.
as_view
(),
name
=
'orders_update_form'
),
path
(
'froyo/orders/create/'
,
Orders_CreateFormView
.
as_view
(),
name
=
'orders_create_form'
),
path
(
'ingredients/list/'
,
Ingredients_ListView
.
as_view
(),
name
=
'ingredients_list'
),
path
(
'ingredients/detail/'
,
Ingredients_DetailView
.
as_view
(),
name
=
'ingredients_detail'
),
path
(
'ingredients/update/'
,
Ingredients_UpdateFormView
.
as_view
(),
name
=
'ingredients_update_form'
),
path
(
'ingredients/create/'
,
Ingredients_CreateFormView
.
as_view
(),
name
=
'ingredients_create_form'
),
path
(
'recipes/list/'
,
Recipes_ListView
.
as_view
(),
name
=
'recipes_list'
),
path
(
'recipes/detail/'
,
Recipes_DetailView
.
as_view
(),
name
=
'recipes_detail'
),
path
(
'recipes/update/'
,
Recipes_UpdateFormView
.
as_view
(),
name
=
'recipes_update_form'
),
path
(
'recipes/create/'
,
Recipes_CreateFormView
.
as_view
(),
name
=
'recipes_create_form'
),
path
(
'orders/list/'
,
Orders_ListView
.
as_view
(),
name
=
'orders_list'
),
path
(
'orders/detail/'
,
Orders_DetailView
.
as_view
(),
name
=
'orders_detail'
),
path
(
'orders/update/'
,
Orders_UpdateFormView
.
as_view
(),
name
=
'orders_update_form'
),
path
(
'orders/create/'
,
Orders_CreateFormView
.
as_view
(),
name
=
'orders_create_form'
),
]
\ No newline at end of file
froyo/views.py
View file @
709ea056
...
...
@@ -6,8 +6,6 @@ from django.shortcuts import render
# Create your views here.
class
HomePage
(
TemplateView
):
template_name
=
'froyo.html'
class
Ingredients_ListView
(
TemplateView
):
template_name
=
'ingredients_list.html'
...
...
thegoodplace/__pycache__/settings.cpython-38.pyc
View file @
709ea056
No preview for this file type
thegoodplace/__pycache__/urls.cpython-38.pyc
View file @
709ea056
No preview for this file type
thegoodplace/settings.py
View file @
709ea056
...
...
@@ -55,7 +55,7 @@ ROOT_URLCONF = 'thegoodplace.urls'
TEMPLATES
=
[
{
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'DIRS'
:
[],
'DIRS'
:
[
'templates'
],
'APP_DIRS'
:
True
,
'OPTIONS'
:
{
'context_processors'
:
[
...
...
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