Commit 9be21ac5 authored by Keith Adrian Santos's avatar Keith Adrian Santos

added the recipes codes to froyo views, urls and test. Ran Test.py and...

added the recipes codes to froyo views, urls and test. Ran Test.py and functional_test.py and both work error free wahoo.
parent e694b153
from django.test import TestCase
# Test Cases for Home Pages!
class FroyoHomePageTest(TestCase):
def test_froyo_home_page_returns_correct_html(self):
......@@ -21,6 +22,7 @@ class RecipesPageTest(TestCase):
response = self.client.get('/recipes')
self.assertTemplateUsed(response, 'recipes_home.html')
#Test Cases for Ingredient Pages!
class IngredientsListPageTest(TestCase):
def test_ingredients_list_page_returns_correct_html(self):
......@@ -62,4 +64,26 @@ class OrdersUpdatePageTest(TestCase):
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
self.assertTemplateUsed(response, 'orders_create_form.html')
#Test Cases for Recipes Pages!
class RecipesListPageTest(TestCase):
def test_recipes_list_page_returns_correct_html(self):
response = self.client.get('/recipes/list')
self.assertTemplateUsed(response, 'recipes_list.html')
class RecipesDetailPageTest(TestCase):
def test_recipes_detail_page_returns_correct_html(self):
response = self.client.get('/recipes/detail')
self.assertTemplateUsed(response, 'recipes_detail.html')
class RecipesUpdatePageTest(TestCase):
def test_recipes_update_page_returns_correct_html(self):
response = self.client.get('/recipes/update')
self.assertTemplateUsed(response, 'recipes_update_form.html')
class RecipesCreatePageTest(TestCase):
def test_recipes_create_page_returns_correct_html(self):
response = self.client.get('/recipes/create')
self.assertTemplateUsed(response, 'recipes_create_form.html')
\ No newline at end of file
from django.conf.urls import url
from.views import FroyoView, IngredientsHomeView, OrdersHomeView, RecipesHomeView
from.views import IngredientsListView, IngredientsDetailView, IngredientsUpdateView, IngredientsCreateView
from.views import OrdersListView, OrdersDetailView, OrdersUpdateView, OrdersCreateView
from.views import RecipesListView, RecipesDetailView, RecipesUpdateView, RecipesCreateView
urlpatterns = [
url(r'^$',FroyoView.as_view(),name='froyo_home'),
url(r'^ingredients$',IngredientsHomeView.as_view(),name='ingredients_home'),
......@@ -19,4 +24,9 @@ urlpatterns = [
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'),
url(r'^recipes/list$',RecipesListView.as_view(),name='recipes_list'),
url(r'^recipes/detail$',RecipesDetailView.as_view(),name='recipes_detail'),
url(r'^recipes/update$',RecipesUpdateView.as_view(),name='recipes_update_form'),
url(r'^recipes/create$',RecipesCreateView.as_view(),name='recipes_create_form'),
]
\ No newline at end of file
from django.shortcuts import render
from django.views.generic.base import TemplateView
#I'll use TemplateView for all bec the others views need SQL ata and we won't do models pa right?
#Views for Home Pages
class FroyoView(TemplateView):
template_name = "froyo_home.html"
......@@ -38,4 +41,17 @@ class OrdersUpdateView(TemplateView):
template_name = "orders_update_form.html"
class OrdersCreateView(TemplateView):
template_name = "orders_create_form.html"
\ No newline at end of file
template_name = "orders_create_form.html"
#Views for Recipes Pages
class RecipesListView(TemplateView):
template_name = "recipes_list.html"
class RecipesDetailView(TemplateView):
template_name = "recipes_detail.html"
class RecipesUpdateView(TemplateView):
template_name = "recipes_update_form.html"
class RecipesCreateView(TemplateView):
template_name = "recipes_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