Commit 709ea056 authored by abbeeeeyyyyy's avatar abbeeeeyyyyy

Fixed the assertionError. Templates are now rendered

parent 5bdeba94
......@@ -2,7 +2,6 @@ from django.test import TestCase
from django.urls import resolve
from django.http import HttpRequest
from .views import HomePage
from .views import Ingredients_ListView
from .views import Ingredients_DetailView
......@@ -27,55 +26,52 @@ from django.template.loader import render_to_string
# Create your tests here.
class TheGoodPlaceSiteTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('froyo/')
self.assertTemplateUsed(response, 'froyo.html')
def test_ingredients_list_page_returns_correct_html(self):
response = self.client.get('froyo/ingredients/list/')
response = self.client.get('/ingredients/list/')
self.assertTemplateUsed(response,'ingredients_list.html')
def test_ingredients_detail_page_returns_correct_html(self):
response = self.client.get('froyo/ingredients/detail/')
response = self.client.get('/ingredients/detail/')
self.assertTemplateUsed(response, 'ingredients_detail.html')
def test_ingredients_update_page_returns_correct_html(self):
response = self.client.get('froyo/ingredients/update/')
response = self.client.get('/ingredients/update/')
self.assertTemplateUsed(response, 'ingredients_update_form.html')
def test_ingredients_create_page_returns_correct_html(self):
response = self.client.get('froyo/ingredients/create/')
response = self.client.get('/ingredients/create/')
self.assertTemplateUsed(response, 'ingredients_create_form.html')
def test_recipe_list_page_returns_correct_html(self):
response = self.client.get('froyo/recipes/list/')
self.assertTemplateUsed(response,'recipe_list.html')
response = self.client.get('/recipes/list/')
self.assertTemplateUsed(response,'recipes_list.html')
def test_recipe_detail_page_returns_correct_html(self):
response = self.client.get('froyo/recipes/detail/')
response = self.client.get('/recipes/detail/')
self.assertTemplateUsed(response, 'recipes_detail.html')
def test_recipe_update_page_returns_correct_html(self):
response = self.client.get('froyo/recipes/update/')
response = self.client.get('/recipes/update/')
self.assertTemplateUsed(response, 'recipes_update_form.html')
def test_recipe_create_form_page_returns_correct_html(self):
response = self.client.get('froyo/recipes/create/')
response = self.client.get('/recipes/create/')
self.assertTemplateUsed(response, 'recipes_create_form.html')
def test_orders_list_page_returns_correct_html(self):
response = self.client.get('froyo/orders/list/')
response = self.client.get('/orders/list/')
self.assertTemplateUsed(response,'orders_list.html')
def test_orders_detail_page_returns_correct_html(self):
response = self.client.get('froyo/orders/detail/')
response = self.client.get('/orders/detail/')
self.assertTemplateUsed(response, 'orders_detail.html')
def test_orders_update_form_page_returns_correct_html(self):
response = self.client.get('froyo/orders/update/')
response = self.client.get('/orders/update/')
self.assertTemplateUsed(response, 'orders_update_form.html')
def test_orders_create_form_page_returns_correct_html(self):
response = self.client.get('froyo/orders/create/')
response = self.client.get('/orders/create/')
self.assertTemplateUsed(response, 'orders_create_form.html')
from django.urls import path
from django.contrib import admin
from .views import HomePage
from .views import Ingredients_ListView
from .views import Ingredients_DetailView
......@@ -22,21 +21,19 @@ from .views import Orders_CreateFormView
urlpatterns = [
path('', HomePage.as_view(), name='froyo'),
path('froyo/', HomePage.as_view(), name='froyo'),
path('froyo/ingredients/list/', Ingredients_ListView.as_view(), name='ingredients_list'),
path('froyo/ingredients/detail/', Ingredients_DetailView.as_view(), name='ingredients_detail'),
path('froyo/ingredients/update/', Ingredients_UpdateFormView.as_view(), name='ingredients_update_form'),
path('froyo/ingredients/create/', Ingredients_CreateFormView.as_view(), name='ingredients_create_form'),
path('froyo/recipes/list/', Recipes_ListView.as_view(), name='recipes_list'),
path('froyo/recipes/detail/', Recipes_DetailView.as_view(), name='recipes_detail'),
path('froyo/recipes/update/', Recipes_UpdateFormView.as_view(), name='recipes_update_form'),
path('froyo/recipes/create/', Recipes_CreateFormView.as_view(), name='recipes_create_form'),
path('froyo/orders/list/', Orders_ListView.as_view(), name='orders_list'),
path('froyo/orders/detail/', Orders_DetailView.as_view(), name='orders_detail'),
path('froyo/orders/update/', Orders_UpdateFormView.as_view(), name='orders_update_form'),
path('froyo/orders/create/', Orders_CreateFormView.as_view(), name='orders_create_form'),
path('ingredients/list/', Ingredients_ListView.as_view(), name='ingredients_list'),
path('ingredients/detail/', Ingredients_DetailView.as_view(), name='ingredients_detail'),
path('ingredients/update/', Ingredients_UpdateFormView.as_view(), name='ingredients_update_form'),
path('ingredients/create/', Ingredients_CreateFormView.as_view(), name='ingredients_create_form'),
path('recipes/list/', Recipes_ListView.as_view(), name='recipes_list'),
path('recipes/detail/', Recipes_DetailView.as_view(), name='recipes_detail'),
path('recipes/update/', Recipes_UpdateFormView.as_view(), name='recipes_update_form'),
path('recipes/create/', Recipes_CreateFormView.as_view(), name='recipes_create_form'),
path('orders/list/', Orders_ListView.as_view(), name='orders_list'),
path('orders/detail/', Orders_DetailView.as_view(), name='orders_detail'),
path('orders/update/', Orders_UpdateFormView.as_view(), name='orders_update_form'),
path('orders/create/', Orders_CreateFormView.as_view(), name='orders_create_form'),
]
\ No newline at end of file
......@@ -6,8 +6,6 @@ from django.shortcuts import render
# Create your views here.
class HomePage(TemplateView):
template_name = 'froyo.html'
class Ingredients_ListView(TemplateView):
template_name = 'ingredients_list.html'
......
......@@ -55,7 +55,7 @@ ROOT_URLCONF = 'thegoodplace.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': ['templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
......
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