Commit 36dad994 authored by John Carlos Sanil's avatar John Carlos Sanil

Merge branch 'recipes-branch' into 'develop'

United Tested and Created Recipes Views

See merge request !7
parents 907b44ab 5b024f62
<html>
<head>
<title>Recipes - Create</title>
</head>
<body>
<h1>Recipes - Create</h1>
</body>
</html>
<html>
<head>
<title>Recipes - Detail</title>
</head>
<body>
<h1>Recipes - Detail</h1>
</body>
</html>
<html>
<head>
<title>Recipes - List</title>
</head>
<body>
<h1>Recipes - List</h1>
</body>
</html>
<html>
<head>
<title>Recipes - Update</title>
</head>
<body>
<h1>Recipes - Update</h1>
</body>
</html>
......@@ -26,3 +26,22 @@ class IngredientsPageTests(TestCase):
def test_ingredients_create_returns_correct_html(self):
response = self.client.get('/ingredients_create_form')
self.assertTemplateUsed(response, 'ingredients_create_form.html')
class RecipesPageTests(TestCase):
def test_recipes_list_returns_correct_html(self):
response = self.client.get('/recipes_list')
self.assertTemplateUsed(response, 'recipes_list.html')
def test_recipes_detail_returns_correct_html(self):
response = self.client.get('/recipes_detail')
self.assertTemplateUsed(response, 'recipes_detail.html')
def test_recipes_update_returns_correct_html(self):
response = self.client.get('/recipes_update_form')
self.assertTemplateUsed(response, 'recipes_update_form.html')
def test_recipes_create_returns_correct_html(self):
response = self.client.get('/recipes_create_form')
self.assertTemplateUsed(response, 'recipes_create_form.html')
\ No newline at end of file
from django.conf.urls import url
from .views import HomePageView, IngredientsListView, IngredientsDetailView, IngredientsUpdateView, IngredientsCreateView
from .views import HomePageView
from .views import IngredientsListView, IngredientsDetailView, IngredientsUpdateView, IngredientsCreateView
from .views import RecipesListView, RecipesDetailView, RecipesUpdateView, RecipesCreateView
urlpatterns = [
......@@ -8,5 +10,10 @@ urlpatterns = [
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')
url(r'^ingredients_create_form$', IngredientsCreateView.as_view(), name='ingredients_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_form$', RecipesUpdateView.as_view(), name='recipes_update_form'),
url(r'^recipes_create_form$', RecipesCreateView.as_view(), name='recipes_create_form')
]
\ No newline at end of file
......@@ -7,6 +7,7 @@ from django.views.generic.base import TemplateView
class HomePageView(TemplateView):
template_name = "home.html"
class IngredientsListView(TemplateView):
template_name = "ingredients_list.html"
......@@ -18,3 +19,16 @@ class IngredientsUpdateView(TemplateView):
class IngredientsCreateView(TemplateView):
template_name = "ingredients_create_form.html"
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