Commit dea8e05b authored by cianlaguesma's avatar cianlaguesma

Merge branch 'develop'

parents d6e27b75 c01e69be
from django.test import TestCase
# Create your tests here.
class HomeTest(TestCase):
def test_home_uses_template(self):
response = self.client.get('/index')
self.assertTemplateUsed(response, 'index.html')
class IngredientsTest(TestCase):
def test_ingredients_use_list_template(self):
response = self.client.get('/ingredients/list')
self.assertTemplateUsed(response, 'ingredients_list.html')
def test_ingredients_use_detail_template(self):
response = self.client.get('/ingredients/detail')
self.assertTemplateUsed(response, 'ingredients_detail.html')
def test_ingredients_use_update_form_template(self):
response = self.client.get('/ingredients/update_form')
self.assertTemplateUsed(response, 'ingredients_update_form.html')
def test_ingredients_use_create_form_template(self):
response = self.client.get('/ingredients/create_form')
self.assertTemplateUsed(response, 'ingredients_create_form.html')
class OrdersTest(TestCase):
def test_orders_use_list_template(self):
response = self.client.get('/orders/list')
self.assertTemplateUsed(response, 'orders_list.html')
def test_orders_use_detail_template(self):
response = self.client.get('/orders/detail')
self.assertTemplateUsed(response, 'orders_detail.html')
def test_orders_use_update_form_template(self):
response = self.client.get('/orders/update_form')
self.assertTemplateUsed(response, 'orders_update_form.html')
def test_orders_use_create_form_template(self):
response = self.client.get('/orders/create_form')
self.assertTemplateUsed(response, 'orders_create_form.html')
class RecipesTest(TestCase):
def test_recipes_use_list_template(self):
response = self.client.get('/recipes/list')
self.assertTemplateUsed(response, 'recipes_list.html')
def test_recipes_use_detail_template(self):
response = self.client.get('/recipes/detail')
self.assertTemplateUsed(response, 'recipes_detail.html')
def test_recipes_use_update_form_template(self):
response = self.client.get('/recipes/update_form')
self.assertTemplateUsed(response, 'recipes_update_form.html')
def test_recipes_use_create_form_template(self):
response = self.client.get('/recipes/create_form')
self.assertTemplateUsed(response, 'recipes_create_form.html')
from django.conf.urls import url
from .views import ingredients_list, ingredients_detail, ingredients_update_form, ingredients_create_form, recipes_list, recipes_detail, recipes_update_form, recipes_create_form, orders_list, orders_detail, orders_update_form, orders_create_form, home_page
from .views import HomePage,IngredientsCreateForm,IngredientsDetail,IngredientsList,IngredientsUpdateForm,RecipesCreateForm,RecipesDetail,RecipesList,RecipesUpdateForm,OrdersCreateForm,OrdersDetail,OrdersList,OrdersUpdateForm
urlpatterns = [
url(r'^index$', home_page.as_view(), name='home_page'),
url(r'^ingredients/list$', ingredients_list.as_view(), name='ingredients_list'),
url(r'^ingredients/detail$', ingredients_detail.as_view(), name='ingredients_detail'),
url(r'^ingredients/update_form$', ingredients_update_form.as_view(), name='ingredients_update_form'),
url(r'^ingredients/create_form$', ingredients_create_form.as_view(), name='ingredients_create_form'),
url(r'^recipes/list$', recipes_list.as_view(), name='recipes_list'),
url(r'^recipes/detail$', recipes_detail.as_view(), name='recipes_detail'),
url(r'^recipes/update_form$', recipes_update_form.as_view(), name='recipes_update_form'),
url(r'^recipes/create_form$', recipes_create_form.as_view(), name='recipes_create_form'),
url(r'^orders/list$', orders_list.as_view(), name='orders_list'),
url(r'^orders/detail$', orders_detail.as_view(), name='orders_detail'),
url(r'^orders/update_form$', orders_update_form.as_view(), name='orders_update_form'),
url(r'^orders/create_form$', orders_create_form.as_view(), name='recipes_create_form'),
url(r'^index$', HomePage.as_view(), name='home_page'),
url(r'^ingredients/list$', IngredientsList.as_view(), name='ingredients_list'),
url(r'^ingredients/detail$', IngredientsDetail.as_view(), name='ingredients_detail'),
url(r'^ingredients/update_form$', IngredientsUpdateForm.as_view(), name='ingredients_update_form'),
url(r'^ingredients/create_form$', IngredientsCreateForm.as_view(), name='ingredients_create_form'),
url(r'^recipes/list$', RecipesList.as_view(), name='recipes_list'),
url(r'^recipes/detail$', RecipesDetail.as_view(), name='recipes_detail'),
url(r'^recipes/update_form$', RecipesUpdateForm.as_view(), name='recipes_update_form'),
url(r'^recipes/create_form$', RecipesCreateForm.as_view(), name='recipes_create_form'),
url(r'^orders/list$', OrdersList.as_view(), name='orders_list'),
url(r'^orders/detail$', OrdersDetail.as_view(), name='orders_detail'),
url(r'^orders/update_form$', OrdersUpdateForm.as_view(), name='orders_update_form'),
url(r'^orders/create_form$', OrdersCreateForm.as_view(), name='recipes_create_form'),
]
from django.views.generic.base import TemplateView
from django.views.generic.edit import CreateView
class home_page(TemplateView):
class HomePage(TemplateView):
template_name = 'index.html'
class ingredients_list(TemplateView):
class IngredientsList(TemplateView):
template_name = 'ingredients_list.html'
class ingredients_detail(TemplateView):
class IngredientsDetail(TemplateView):
template_name = 'ingredients_detail.html'
class ingredients_update_form(TemplateView):
class IngredientsUpdateForm(TemplateView):
template_name = 'ingredients_update_form.html'
class ingredients_create_form(TemplateView):
class IngredientsCreateForm(TemplateView):
template_name = 'ingredients_create_form.html'
class recipes_list(TemplateView):
class RecipesList(TemplateView):
template_name = 'recipes_list.html'
class recipes_detail(TemplateView):
class RecipesDetail(TemplateView):
template_name = 'recipes_detail.html'
class recipes_update_form(TemplateView):
class RecipesUpdateForm(TemplateView):
template_name = 'recipes_update_form.html'
class recipes_create_form(TemplateView):
class RecipesCreateForm(TemplateView):
template_name = 'recipes_create_form.html'
class orders_list(TemplateView):
class OrdersList(TemplateView):
template_name = 'orders_list.html'
class orders_detail(TemplateView):
class OrdersDetail(TemplateView):
template_name = 'orders_detail.html'
class orders_update_form(TemplateView):
class OrdersUpdateForm(TemplateView):
template_name = 'orders_update_form.html'
class orders_create_form(TemplateView):
class OrdersCreateForm(TemplateView):
template_name = 'orders_create_form.html'
# Create your views here.
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