Commit 9942417a authored by Cidney P. Ciacho's avatar Cidney P. Ciacho

Created tests, will check for errors.

parent 48bb8cc1
Pipeline #1140 canceled with stages
File added
from django.test import TestCase
# Create your tests here.
class IngListTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('ingredients_list')
self.assertTemplateUsed(response, 'ingredients_list.html')
class IngDetailTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('ingredients_detail')
self.assertTemplateUsed(response, 'ingredients_detail.html')
class IngUpdateTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('ingredients_update_form')
self.assertTemplateUsed(response, 'ingredients_update_form.html')
class IngCreateTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('ingredients_create_form')
self.assertTemplateUsed(response, 'ingredients_create_form.html')
class RecipesListTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('recipes_list')
self.assertTemplateUsed(response, 'recipes_list.html')
class RecipesDetailTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('recipes_detail')
self.assertTemplateUsed(response, 'recipes_detail.html')
class RecipesUpdateTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('recipes_update_form')
self.assertTemplateUsed(response, 'recipes_update_form.html')
class RecipesCreateTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('recipes_create_form')
self.assertTemplateUsed(response, 'recipes_create_form.html')
class OrdersListTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('orders_list')
self.assertTemplateUsed(response, 'orders_list.html')
class OrdersDetailTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('orders_detail')
self.assertTemplateUsed(response, 'orders_detail.html')
class OrdersUpdateTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('orders_update_form')
self.assertTemplateUsed(response, 'orders_update_form.html')
class OrdersCreateTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('orders_create_form')
self.assertTemplateUsed(response, 'orders_create_form.html')
\ No newline at end of file
from django.conf.urls import url
from .views import IngListView, IngDetailView, IngUpdateView, IngCreateView, RecipesListView, RecipesDetailView, RecipesUpdateView, RecipesCreateView, OrdersListView, OrdersDetailView, OrdersUpdateView, OrdersCreateView
urlpatterns = [
url(r'^ingredients_list$', IngListView.as_view(), name='ingredients_list'),
url(r'^ingredients_detail$', IngDetailView.as_view(), name='ingredients_detail'),
url(r'^ingredients_update_form$', IngUpdateView.as_view(), name='ingredients_update_form'),
url(r'^ingredients_create_form$', IngCreateView.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'),
url(r'^orders_list$', OrdersListView.as_view(), name='orders_list'),
url(r'^orders_detail$', OrdersDetailView.as_view(), name='orders_detail'),
url(r'^orders_update_form$', OrdersUpdateView.as_view(), name='orders_update_form'),
url(r'^orders_create_form$', OrdersCreateView.as_view(), name='orders_create_form')
]
\ No newline at end of file
from django.shortcuts import render
from django.views.generic.base import TemplateView
class IngListView(TemplateView):
template_name = 'ingredients_list.html'
class IngDetailView(TemplateView):
template_name = 'ingredients_detail.html'
class IngUpdateView(TemplateView):
template_name = ' ingredients_update_form.html'
class IngCreateView(TemplateView):
template_name = 'ingredients_create_form.html'
class RecipesListView(TemplateView):
template_name = 'recipes_list.html'
class RecipesDetailView(TemplateView):
template_name = 'recipes_detail.html'
# Create your views here.
class RecipesUpdateView(TemplateView):
template_name = 'recipes_update_form.html'
class RecipesCreateView(TemplateView):
template_name = 'recipes_create_form.html'
class OrdersListView(TemplateView):
template_name = ' orders_list.html'
class OrdersDetailView(TemplateView):
template_name = 'orders_detail.html'
class OrdersUpdateView(TemplateView):
template_name = 'orders_update_form.html'
class OrdersCreateView(TemplateView):
template_name = 'orders_create_form.html'
from django.shortcuts import render
\ No newline at end of file
......@@ -37,6 +37,8 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'froyo',
'selenium',
]
MIDDLEWARE = [
......
......@@ -13,9 +13,10 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', include('froyo.urls') ),
]
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