Added views.

parent f9222deb
<!DOCTYPE html>
<html>
<head>
<title>The Good Place FroYo Shop</title>
</head>
</html>
from django.shortcuts import render from django.views.generic.base import TemplateView
# Create your views here.
class HomeView(TemplateView):
template_name = "home.html"
class OrdersListView(TemplateView):
template_name = "orders_list.html"
class OrdersDetailView(TemplateView):
template_name = "orders_detail.html"
class OrdersUpdateView(TemplateView):
template_name = "orders_update.html"
class OrdersCreateView(TemplateView):
template_name = "orders_create.html"
class RecipesListView(TemplateView):
template_name = "recipes_list.html"
class RecipesDetailView(TemplateView):
template_name = "recipes_detail.html"
class RecipesUpdateView(TemplateView):
template_name = "recipes_update.html"
class RecipesCreateView(TemplateView):
template_name = "recipes_create.html"
class IngredientsListView(TemplateView):
template_name = "ingredients_list.html"
class IngredientsDetailView(TemplateView):
template_name = "ingredients_detail.html"
class IngredientsUpdateView(TemplateView):
template_name = "ingredients_update.html"
class IngredientsCreateView(TemplateView):
template_name = "ingredients_create.html"
...@@ -10,6 +10,13 @@ class NewVisitorTest(unittest.TestCase): ...@@ -10,6 +10,13 @@ class NewVisitorTest(unittest.TestCase):
def tearDown(self): def tearDown(self):
self.browser.quit() self.browser.quit()
def test_can_go_to_home(self):
#Wishing to have a look at all the available options, our employee goes to the home page.
self.browser.get('http://localhost:8000/')
#Hoping he isn't wrong, he looks at the page title to double check.
self.assertIn('The Good Place FroYo Shop', self.browser.title)
def test_can_add_orders(self): def test_can_add_orders(self):
#A customer orders a certain froyo. An employee processes the order, verifying that they are on the correct page. #A customer orders a certain froyo. An employee processes the order, verifying that they are on the correct page.
self.browser.get('http://localhost:8000/orders/list') self.browser.get('http://localhost:8000/orders/list')
......
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