Commit 64fe86f9 authored by Ayn Collado's avatar Ayn Collado

Finished tests, partially added templates

parent b2367738
import unittest
from selenium import webdriver
from django.urls import resolve
import unittest
class NewVisitorTest(unittest.TestCase):
def setUp(self):
......@@ -12,51 +12,87 @@ class NewVisitorTest(unittest.TestCase):
def test_every_test_is_in_here(self):
#test_display_ingredients_list
self.browser.get('http://localhost:8000/froyo/ingredients_list/')
header_value = 'Ingredients - List'
self.assertIn('Ingredients - List', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_ingredients_detail
self.browser.get('http://localhost:8000/froyo/ingredients_detail/')
header_value = 'Ingredients - Detail'
self.assertIn('Ingredients - Detail', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_ingredients_update_form
self.browser.get('http://localhost:8000/froyo/ingredients_update_form/')
header_value = 'Ingredients - Update'
self.assertIn('Ingredients - Update', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_ingredients_create_form
self.browser.get('http://localhost:8000/froyo/ingredients_create_form/')
header_value = 'Ingredients - Create'
self.assertIn('Ingredients - Create', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_recipes_list
self.browser.get('http://localhost:8000/froyo/recipes_list/')
header_value = 'Recipes - List'
self.assertIn('Recipes - List', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_recipes_detail
self.browser.get('http://localhost:8000/froyo/recipes_detail/')
header_value = 'Recipes - Detail'
self.assertIn('Recipes - Detail', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_recipes_update_form
self.browser.get('http://localhost:8000/froyo/recipes_update_form/')
header_value = 'Recipes - Update'
self.assertIn('Recipes - Update', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_recipes_create_form
self.browser.get('http://localhost:8000/froyo/recipes_create_form/')
header_value = 'Recipes - Create'
self.assertIn('Recipes - Create', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_orders_list
self.browser.get('http://localhost:8000/froyo/orders_list/')
header_value = 'Orders - List'
self.assertIn('Orders - List', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_orders_detail
self.browser.get('http://localhost:8000/froyo/orders_detail/')
header_value = 'Orders - Detail'
self.assertIn('Orders - Detail', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_orders_update_form
self.browser.get('http://localhost:8000/froyo/orders_update_form/')
header_value = 'Orders - Update'
self.assertIn('Orders - Update', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_orders_list
self.browser.get('http://localhost:8000/froyo/orders_create_form/')
header_value = 'Orders - Create'
self.assertIn('Orders - Create', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value)
def test_Fail_Test(self):
self.fail('Finished the test!')
......
<html>
<head>
<title>Ingredients - Create</title>
</head>
<body>
<h1>Ingredients - Create</h1>
</html>
\ No newline at end of file
<html>
<head>
<title>Ingredients - Detail</title>
</head>
<body>
<h1>Ingredients - Detail</h1>
</html>
\ No newline at end of file
<html>
<head>
<title>Ingredients - List</title>
</head>
<body>
<h1>Ingredients - List</h1>
</html>
\ No newline at end of file
<html>
<head>
<title>Ingredients - Update</title>
</head>
<body>
<h1>Ingredients - Update</h1>
</html>
\ No newline at end of file
<html>
<head>
<title>Recipes - List</title>
</head>
<body>
<h1>Recipes - List</h1>
</html>
\ No newline at end of file
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