Commit ec111ac0 authored by Keith Adrian Santos's avatar Keith Adrian Santos

added all the ingredient aspects in test, views and urls. Ran the test.py and no problem!

parent 7b261226
from django.test import TestCase
# Test Cases for Home Pages!
class FroyoHomePageTest(TestCase):
def test_froyo_home_page_returns_correct_html(self):
response = self.client.get('/')
......@@ -20,4 +20,24 @@ class RecipesPageTest(TestCase):
def test_recipes_home_page_returns_correct_html(self):
response = self.client.get('/recipes')
self.assertTemplateUsed(response, 'recipes_home.html')
# Create your tests here.
#Test Cases for Ingredient Pages!
class IngredientsListPageTest(TestCase):
def test_ingredients_list_page_returns_correct_html(self):
response = self.client.get('/ingredients/list')
self.assertTemplateUsed(response, 'ingredients_list.html')
class IngredientsDetailPageTest(TestCase):
def test_ingredients_detail_page_returns_correct_html(self):
response = self.client.get('/ingredients/detail')
self.assertTemplateUsed(response, 'ingredients_detail.html')
class IngredientsUpdatePageTest(TestCase):
def test_ingredients_update_page_returns_correct_html(self):
response = self.client.get('/ingredients/update')
self.assertTemplateUsed(response, 'ingredients_update_form.html')
class IngredientsCreatePageTest(TestCase):
def test_ingredients_create_page_returns_correct_html(self):
response = self.client.get('/ingredients/create')
self.assertTemplateUsed(response, 'ingredients_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 FroyoView, IngredientsHomeView, OrdersHomeView, RecipesHomeView
from.views import IngredientsListView, IngredientsDetailView, IngredientsUpdateView, IngredientsCreateView
urlpatterns = [
url(r'^$',FroyoView.as_view(),name='froyo_home'),
url(r'^ingredients$',IngredientsHomeView.as_view(),name='ingredients_home'),
url(r'^orders$',OrdersHomeView.as_view(),name='orders_home'),
url(r'^recipes$',RecipesHomeView.as_view(),name='recipies_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$',IngredientsUpdateView.as_view(),name='ingredients_update_form'),
url(r'^ingredients/create$',IngredientsCreateView.as_view(),name='ingredients_create_form'),
]
\ No newline at end of file
from django.shortcuts import render
from django.views.generic.base import TemplateView
# Create your views here.
#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"
......@@ -11,4 +12,17 @@ class OrdersHomeView(TemplateView):
template_name = "orders_home.html"
class RecipesHomeView(TemplateView):
template_name = "recipes_home.html"
\ No newline at end of file
template_name = "recipes_home.html"
#Views for Ingredients Pages
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