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>
...@@ -25,4 +25,23 @@ class IngredientsPageTests(TestCase): ...@@ -25,4 +25,23 @@ class IngredientsPageTests(TestCase):
def test_ingredients_create_returns_correct_html(self): def test_ingredients_create_returns_correct_html(self):
response = self.client.get('/ingredients_create_form') response = self.client.get('/ingredients_create_form')
self.assertTemplateUsed(response, 'ingredients_create_form.html') self.assertTemplateUsed(response, 'ingredients_create_form.html')
\ No newline at end of file
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 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 = [ urlpatterns = [
...@@ -8,5 +10,10 @@ urlpatterns = [ ...@@ -8,5 +10,10 @@ urlpatterns = [
url(r'^ingredients_list$', IngredientsListView.as_view(), name='ingredients_list'), url(r'^ingredients_list$', IngredientsListView.as_view(), name='ingredients_list'),
url(r'^ingredients_detail$', IngredientsDetailView.as_view(), name='ingredients_detail'), 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_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 ...@@ -7,6 +7,7 @@ from django.views.generic.base import TemplateView
class HomePageView(TemplateView): class HomePageView(TemplateView):
template_name = "home.html" template_name = "home.html"
class IngredientsListView(TemplateView): class IngredientsListView(TemplateView):
template_name = "ingredients_list.html" template_name = "ingredients_list.html"
...@@ -17,4 +18,17 @@ class IngredientsUpdateView(TemplateView): ...@@ -17,4 +18,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
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