Commit 1f073eb9 authored by Kevin Sibug's avatar Kevin Sibug

Added unit tests for views

parent e2288c49
from django.test import TestCase from django.test import TestCase
#Ingedients Test
class IngredientsListTest(TestCase):
def test_can_get_create_template(self):
response = self.client.get('/ingredients/list/')
self.assertTemplateUsed(response, 'ingredients_list.html')
class IngredientsDetailTest(TestCase):
def test_can_get_create_template(self):
response = self.client.get('/ingredients/detail/')
self.assertTemplateUsed(response, 'ingredients_detail.html')
class IngredientsUpdateTest(TestCase):
def test_can_get_create_template(self):
response = self.client.get('/ingredients/update_form/')
self.assertTemplateUsed(response, 'ingredients_update_form.html')
class IngredientsCreateTest(TestCase):
def test_can_get_create_template(self):
response = self.client.get('/ingredients/create_form/')
self.assertTemplateUsed(response, 'ingredients_create_form.html')
#Recipes Test
class RecipesListTest(TestCase):
def test_can_get_create_template(self):
response = self.client.get('/recipes/list/')
self.assertTemplateUsed(response, 'recipes_list.html')
class RecipesDetailTest(TestCase):
def test_can_get_create_template(self):
response = self.client.get('/recipes/detail/')
self.assertTemplateUsed(response, 'recipes_detail.html')
class RecipesUpdateTest(TestCase):
def test_can_get_create_template(self):
response = self.client.get('/recipes/update_form/')
self.assertTemplateUsed(response, 'recipes_update_form.html')
class RecipesCreateTest(TestCase):
def test_can_get_create_template(self):
response = self.client.get('/recipes/create_form/')
self.assertTemplateUsed(response, 'recipes_create_form.html')
#Orders Test
class OrdersListTest(TestCase):
def test_can_get_create_template(self):
response = self.client.get('/orders/list/')
self.assertTemplateUsed(response, 'orders_list.html')
class OrdersDetailTest(TestCase):
def test_can_get_create_template(self):
response = self.client.get('/orders/detail/')
self.assertTemplateUsed(response, 'orders_detail.html')
class OrdersUpdateTest(TestCase):
def test_can_get_create_template(self):
response = self.client.get('/orders/update_form/')
self.assertTemplateUsed(response, 'orders_update_form.html')
class OrdersCreateTest(TestCase):
def test_can_get_create_template(self):
response = self.client.get('/orders/create_form/')
self.assertTemplateUsed(response, 'orders_create_form.html')
# Create your tests 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