Commit 9d853090 authored by Carlowsss's avatar Carlowsss

Unit Tested and Created Orders Views

parent 36dad994
<html>
<head>
<title>Orders - Create</title>
</head>
<body>
<h1>Orders - Create</h1>
</body>
</html>
<html>
<head>
<title>Orders - Detail</title>
</head>
<body>
<h1>Orders - Detail</h1>
</body>
</html>
<html>
<head>
<title>Orders - List</title>
</head>
<body>
<h1>Orders - List</h1>
</body>
</html>
<html>
<head>
<title>Orders - Update</title>
</head>
<body>
<h1>Orders - Update</h1>
</body>
</html>
...@@ -45,3 +45,23 @@ class RecipesPageTests(TestCase): ...@@ -45,3 +45,23 @@ class RecipesPageTests(TestCase):
def test_recipes_create_returns_correct_html(self): def test_recipes_create_returns_correct_html(self):
response = self.client.get('/recipes_create_form') response = self.client.get('/recipes_create_form')
self.assertTemplateUsed(response, 'recipes_create_form.html') self.assertTemplateUsed(response, 'recipes_create_form.html')
class OrdersPageTests(TestCase):
def test_orders_list_returns_correct_html(self):
response = self.client.get('/orders_list')
self.assertTemplateUsed(response, 'orders_list.html')
def test_orders_detail_returns_correct_html(self):
response = self.client.get('/orders_detail')
self.assertTemplateUsed(response, 'orders_detail.html')
def test_orders_update_returns_correct_html(self):
response = self.client.get('/orders_update_form')
self.assertTemplateUsed(response, 'orders_update_form.html')
def test_orders_create_returns_correct_html(self):
response = self.client.get('/orders_create_form')
self.assertTemplateUsed(response, 'orders_create_form.html')
\ No newline at end of file
...@@ -3,7 +3,7 @@ from django.conf.urls import url ...@@ -3,7 +3,7 @@ from django.conf.urls import url
from .views import HomePageView from .views import HomePageView
from .views import IngredientsListView, IngredientsDetailView, IngredientsUpdateView, IngredientsCreateView from .views import IngredientsListView, IngredientsDetailView, IngredientsUpdateView, IngredientsCreateView
from .views import RecipesListView, RecipesDetailView, RecipesUpdateView, RecipesCreateView from .views import RecipesListView, RecipesDetailView, RecipesUpdateView, RecipesCreateView
from .views import OrdersListView, OrdersDetailView, OrdersUpdateView, OrdersCreateView
urlpatterns = [ urlpatterns = [
url(r'^$', HomePageView.as_view(), name='home'), url(r'^$', HomePageView.as_view(), name='home'),
...@@ -14,6 +14,9 @@ urlpatterns = [ ...@@ -14,6 +14,9 @@ urlpatterns = [
url(r'^recipes_list$', RecipesListView.as_view(), name='recipes_list'), url(r'^recipes_list$', RecipesListView.as_view(), name='recipes_list'),
url(r'^recipes_detail$', RecipesDetailView.as_view(), name='recipes_detail'), url(r'^recipes_detail$', RecipesDetailView.as_view(), name='recipes_detail'),
url(r'^recipes_update_form$', RecipesUpdateView.as_view(), name='recipes_update_form'), url(r'^recipes_update_form$', RecipesUpdateView.as_view(), name='recipes_update_form'),
url(r'^recipes_create_form$', RecipesCreateView.as_view(), name='recipes_create_form') url(r'^recipes_create_form$', RecipesCreateView.as_view(), name='recipes_create_form'),
url(r'^orders_list$', OrdersListView.as_view(), name='orders_list'),
url(r'^orders_detail$', OrdersDetailView.as_view(), name='orders_detail'),
url(r'^orders_update_form$', OrdersUpdateView.as_view(), name='orders_update_form'),
url(r'^orders_create_form$', OrdersCreateView.as_view(), name='orders_create_form')
] ]
\ No newline at end of file
...@@ -32,3 +32,16 @@ class RecipesUpdateView(TemplateView): ...@@ -32,3 +32,16 @@ class RecipesUpdateView(TemplateView):
class RecipesCreateView(TemplateView): class RecipesCreateView(TemplateView):
template_name = "recipes_create_form.html" template_name = "recipes_create_form.html"
class OrdersListView(TemplateView):
template_name = "orders_list.html"
class OrdersDetailView(TemplateView):
template_name = "orders_detail.html"
class OrdersUpdateView(TemplateView):
template_name = "orders_update_form.html"
class OrdersCreateView(TemplateView):
template_name = "orders_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