Commit 16d64c39 authored by Carlowsss's avatar Carlowsss

Unit Tested and Created Ingredients Views

parent f742b982
......@@ -2,5 +2,7 @@
<head>
<title>The Good Place FroYo Shop</title>
</head>
<h1>The Good Place FroYo Shop</h1>
<body>
<h1>The Good Place FroYo Shop</h1>
</body>
</html>
<html>
<head>
<title>Ingredients - Update</title>
</head>
<body>
<h1>Ingredients - Update</h1>
</body>
</html>
<html>
<head>
<title>Ingredients - Detail</title>
</head>
<body>
<h1>Ingredients - Detail</h1>
</body>
</html>
<html>
<head>
<title>Ingredients - List</title>
</head>
<body>
<h1>Ingredients - List</h1>
</body>
</html>
<html>
<head>
<title>Ingredients - Update</title>
</head>
<body>
<h1>Ingredients - Update</h1>
</body>
</html>
......@@ -8,3 +8,21 @@ class HomePageTest(TestCase):
response = self.client.get('/')
self.assertTemplateUsed(response, 'home.html')
class IngredientsPageTests(TestCase):
def test_ingredients_list_returns_correct_html(self):
response = self.client.get('/ingredients_list')
self.assertTemplateUsed(response, 'ingredients_list.html')
def test_ingredients_detail_returns_correct_html(self):
response = self.client.get('/ingredients_detail')
self.assertTemplateUsed(response, 'ingredients_detail.html')
def test_ingredients_update_returns_correct_html(self):
response = self.client.get('/ingredients_update_form')
self.assertTemplateUsed(response, 'ingredients_update_form.html')
def test_ingredients_create_returns_correct_html(self):
response = self.client.get('/ingredients_create_form')
self.assertTemplateUsed(response, 'ingredients_create_form.html')
\ No newline at end of file
from django.conf.urls import url
from .views import HomePageView
from .views import HomePageView, IngredientsListView, IngredientsDetailView, IngredientsUpdateView, IngredientsCreateView
urlpatterns = [
url(r'^$', HomePageView.as_view(), name='home'),
url(r'^ingredients_list$', IngredientsListView.as_view(), name='ingredients_list'),
url(r'^ingredients_detail$', IngredientsDetailView.as_view(), name='ingredients_detail'),
url(r'^ingredients_update_form$', IngredientsUpdateView.as_view(), name='ingredients_update_form'),
url(r'^ingredients_create_form$', IngredientsCreateView.as_view(), name='ingredients_create_form')
]
\ No newline at end of file
......@@ -5,4 +5,16 @@ from django.views.generic.base import TemplateView
# Create your views here.
class HomePageView(TemplateView):
template_name = "home.html"
\ No newline at end of file
template_name = "home.html"
class IngredientsListView(TemplateView):
template_name = "ingredients_list.html"
class IngredientsDetailView(TemplateView):
template_name = "ingredients_detail.html"
class IngredientsUpdateView(TemplateView):
template_name = "ingredients_update_form.html"
class IngredientsCreateView(TemplateView):
template_name = "ingredients_create_form.html"
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment