from django.test import TestCase
from django.urls import resolve
from django.http import HttpRequest

from .views import HomePageView
from .views import IngredientsListView
from .views import IngredientsDetailView
from .views import IngredientsUpdateView
from .views import IngredientsCreateView
from .views import RecipesListView
from .views import RecipesDetailView
from .views import RecipesUpdateView
from .views import RecipesCreateView
from .views import OrdersListView
from .views import OrdersDetailView
from .views import OrdersUpdateView
from .views import OrdersCreateView

class FroyoListPageTest(TestCase):

	def test_home_page(self):
		response = self.client.get('/home/')
		self.assertTemplateUsed(response, 'home.html')
		
	def test_ingredients_list_page(self):
		response = self.client.get('/home/ingredients/')
		self.assertTemplateUsed(response, 'ingredients_list.html')
		
	def test_ingredients_detail_page(self):
		response = self.client.get('/home/ingredients/detail/')
		self.assertTemplateUsed(response, 'ingredients_detail.html')
	
	def test_ingredients_update_page(self):
		response = self.client.get('/home/ingredients/update/')
		self.assertTemplateUsed(response, 'ingredients_update_form.html')
		
	def test_ingredients_create_page(self):
		response = self.client.get('/home/ingredients/create/')
		self.assertTemplateUsed(response, 'ingredients_create_form.html')
		
	def test_recipes_list_page(self):
		response = self.client.get('/home/recipes/')
		self.assertTemplateUsed(response, 'recipes_list.html')
		
	def test_recipes_detail_page(self):
		response = self.client.get('/home/recipes/detail/')
		self.assertTemplateUsed(response, 'recipes_detail.html')
		
	def test_recipes_update_page(self):
		response = self.client.get('/home/recipes/update/')
		self.assertTemplateUsed(response, 'recipes_update_form.html')
		
	def test_recipes_create_page(self):
		response = self.client.get('/home/recipes/create/')
		self.assertTemplateUsed(response, 'recipes_create_form.html')
		
	def test_orders_list_page(self):
		response = self.client.get('/home/orders/')
		self.assertTemplateUsed(response, 'orders_list.html')
		
	def test_orders_detail_page(self):
		response = self.client.get('/home/orders/detail/')
		self.assertTemplateUsed(response, 'orders_detail.html')
		
	def test_orders_update_page(self):
		response = self.client.get('/home/orders/update/')
		self.assertTemplateUsed(response, 'orders_update_form.html')
		
	def test_orders_create_page(self):
		response = self.client.get('/home/orders/create/')
		self.assertTemplateUsed(response, 'orders_create_form.html')