Commit 947e514d authored by Keith Adrian Santos's avatar Keith Adrian Santos

Added the order details in froyo views, urls and test.py. Also fixed a typo in...

Added the order details in froyo views, urls and test.py. Also fixed a typo in an html. Test.py + functional_test.py work na
parent adfda84b
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Orders - List</title> <title>Orders - Update</title>
</head> </head>
<body> <body>
<header> <header>
......
...@@ -40,4 +40,26 @@ class IngredientsUpdatePageTest(TestCase): ...@@ -40,4 +40,26 @@ class IngredientsUpdatePageTest(TestCase):
class IngredientsCreatePageTest(TestCase): class IngredientsCreatePageTest(TestCase):
def test_ingredients_create_page_returns_correct_html(self): def test_ingredients_create_page_returns_correct_html(self):
response = self.client.get('/ingredients/create') response = self.client.get('/ingredients/create')
self.assertTemplateUsed(response, 'ingredients_create_form.html') self.assertTemplateUsed(response, 'ingredients_create_form.html')
\ No newline at end of file
#Test Cases for Orders Pages!
class OrdersListPageTest(TestCase):
def test_orders_list_page_returns_correct_html(self):
response = self.client.get('/orders/list')
self.assertTemplateUsed(response, 'orders_list.html')
class OrdersDetailPageTest(TestCase):
def test_orders_detail_page_returns_correct_html(self):
response = self.client.get('/orders/detail')
self.assertTemplateUsed(response, 'orders_detail.html')
class OrdersUpdatePageTest(TestCase):
def test_orders_update_page_returns_correct_html(self):
response = self.client.get('/orders/update')
self.assertTemplateUsed(response, 'orders_update_form.html')
class OrdersCreatePageTest(TestCase):
def test_orders_create_page_returns_correct_html(self):
response = self.client.get('/orders/create')
self.assertTemplateUsed(response, 'orders_create_form.html')
\ No newline at end of file
...@@ -2,6 +2,7 @@ from django.conf.urls import url ...@@ -2,6 +2,7 @@ from django.conf.urls import url
from.views import FroyoView, IngredientsHomeView, OrdersHomeView, RecipesHomeView from.views import FroyoView, IngredientsHomeView, OrdersHomeView, RecipesHomeView
from.views import IngredientsListView, IngredientsDetailView, IngredientsUpdateView, IngredientsCreateView from.views import IngredientsListView, IngredientsDetailView, IngredientsUpdateView, IngredientsCreateView
from.views import OrdersListView, OrdersDetailView, OrdersUpdateView, OrdersCreateView
urlpatterns = [ urlpatterns = [
url(r'^$',FroyoView.as_view(),name='froyo_home'), url(r'^$',FroyoView.as_view(),name='froyo_home'),
...@@ -13,4 +14,9 @@ urlpatterns = [ ...@@ -13,4 +14,9 @@ urlpatterns = [
url(r'^ingredients/detail$',IngredientsDetailView.as_view(),name='ingredients_detail'), url(r'^ingredients/detail$',IngredientsDetailView.as_view(),name='ingredients_detail'),
url(r'^ingredients/update$',IngredientsUpdateView.as_view(),name='ingredients_update_form'), url(r'^ingredients/update$',IngredientsUpdateView.as_view(),name='ingredients_update_form'),
url(r'^ingredients/create$',IngredientsCreateView.as_view(),name='ingredients_create_form'), url(r'^ingredients/create$',IngredientsCreateView.as_view(),name='ingredients_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$',OrdersUpdateView.as_view(),name='orders_update_form'),
url(r'^orders/create$',OrdersCreateView.as_view(),name='orders_create_form'),
] ]
\ No newline at end of file
...@@ -13,7 +13,7 @@ class OrdersHomeView(TemplateView): ...@@ -13,7 +13,7 @@ class OrdersHomeView(TemplateView):
class RecipesHomeView(TemplateView): class RecipesHomeView(TemplateView):
template_name = "recipes_home.html" template_name = "recipes_home.html"
#Views for Ingredients Pages #Views for Ingredients Pages
class IngredientsListView(TemplateView): class IngredientsListView(TemplateView):
template_name = "ingredients_list.html" template_name = "ingredients_list.html"
...@@ -25,4 +25,17 @@ class IngredientsUpdateView(TemplateView): ...@@ -25,4 +25,17 @@ class IngredientsUpdateView(TemplateView):
template_name = "ingredients_update_form.html" template_name = "ingredients_update_form.html"
class IngredientsCreateView(TemplateView): class IngredientsCreateView(TemplateView):
template_name = "ingredients_create_form.html" template_name = "ingredients_create_form.html"
\ No newline at end of file
#Views for Orders Pages
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