Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Midterm_Project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayn Collado
Midterm_Project
Commits
64fe86f9
Commit
64fe86f9
authored
Mar 18, 2020
by
Ayn Collado
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished tests, partially added templates
parent
b2367738
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
1 deletion
+77
-1
tests.py
thegoodplace/froyo/tests.py
+37
-1
ingredients_create_form.html
thegoodplace/templates/ingredients_create_form.html
+8
-0
ingredients_detail.html
thegoodplace/templates/ingredients_detail.html
+8
-0
ingredients_list.html
thegoodplace/templates/ingredients_list.html
+8
-0
ingredients_update_form.html
thegoodplace/templates/ingredients_update_form.html
+8
-0
recipes_list.html
thegoodplace/templates/recipes_list.html
+8
-0
No files found.
thegoodplace/froyo/tests.py
View file @
64fe86f9
import
unittest
from
selenium
import
webdriver
from
selenium
import
webdriver
from
django.urls
import
resolve
from
django.urls
import
resolve
import
unittest
class
NewVisitorTest
(
unittest
.
TestCase
):
class
NewVisitorTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -12,51 +12,87 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -12,51 +12,87 @@ class NewVisitorTest(unittest.TestCase):
def
test_every_test_is_in_here
(
self
):
def
test_every_test_is_in_here
(
self
):
#test_display_ingredients_list
#test_display_ingredients_list
self
.
browser
.
get
(
'http://localhost:8000/froyo/ingredients_list/'
)
self
.
browser
.
get
(
'http://localhost:8000/froyo/ingredients_list/'
)
header_value
=
'Ingredients - List'
self
.
assertIn
(
'Ingredients - List'
,
self
.
browser
.
title
)
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
#test_display_ingredients_detail
self
.
browser
.
get
(
'http://localhost:8000/froyo/ingredients_detail/'
)
self
.
browser
.
get
(
'http://localhost:8000/froyo/ingredients_detail/'
)
header_value
=
'Ingredients - Detail'
self
.
assertIn
(
'Ingredients - Detail'
,
self
.
browser
.
title
)
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
#test_display_ingredients_update_form
self
.
browser
.
get
(
'http://localhost:8000/froyo/ingredients_update_form/'
)
self
.
browser
.
get
(
'http://localhost:8000/froyo/ingredients_update_form/'
)
header_value
=
'Ingredients - Update'
self
.
assertIn
(
'Ingredients - Update'
,
self
.
browser
.
title
)
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
#test_display_ingredients_create_form
self
.
browser
.
get
(
'http://localhost:8000/froyo/ingredients_create_form/'
)
self
.
browser
.
get
(
'http://localhost:8000/froyo/ingredients_create_form/'
)
header_value
=
'Ingredients - Create'
self
.
assertIn
(
'Ingredients - Create'
,
self
.
browser
.
title
)
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
#test_display_recipes_list
self
.
browser
.
get
(
'http://localhost:8000/froyo/recipes_list/'
)
self
.
browser
.
get
(
'http://localhost:8000/froyo/recipes_list/'
)
header_value
=
'Recipes - List'
self
.
assertIn
(
'Recipes - List'
,
self
.
browser
.
title
)
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
#test_display_recipes_detail
self
.
browser
.
get
(
'http://localhost:8000/froyo/recipes_detail/'
)
self
.
browser
.
get
(
'http://localhost:8000/froyo/recipes_detail/'
)
header_value
=
'Recipes - Detail'
self
.
assertIn
(
'Recipes - Detail'
,
self
.
browser
.
title
)
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
#test_display_recipes_update_form
self
.
browser
.
get
(
'http://localhost:8000/froyo/recipes_update_form/'
)
self
.
browser
.
get
(
'http://localhost:8000/froyo/recipes_update_form/'
)
header_value
=
'Recipes - Update'
self
.
assertIn
(
'Recipes - Update'
,
self
.
browser
.
title
)
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
#test_display_recipes_create_form
self
.
browser
.
get
(
'http://localhost:8000/froyo/recipes_create_form/'
)
self
.
browser
.
get
(
'http://localhost:8000/froyo/recipes_create_form/'
)
header_value
=
'Recipes - Create'
self
.
assertIn
(
'Recipes - Create'
,
self
.
browser
.
title
)
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
#test_display_orders_list
self
.
browser
.
get
(
'http://localhost:8000/froyo/orders_list/'
)
self
.
browser
.
get
(
'http://localhost:8000/froyo/orders_list/'
)
header_value
=
'Orders - List'
self
.
assertIn
(
'Orders - List'
,
self
.
browser
.
title
)
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
#test_display_orders_detail
self
.
browser
.
get
(
'http://localhost:8000/froyo/orders_detail/'
)
self
.
browser
.
get
(
'http://localhost:8000/froyo/orders_detail/'
)
header_value
=
'Orders - Detail'
self
.
assertIn
(
'Orders - Detail'
,
self
.
browser
.
title
)
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
#test_display_orders_update_form
self
.
browser
.
get
(
'http://localhost:8000/froyo/orders_update_form/'
)
self
.
browser
.
get
(
'http://localhost:8000/froyo/orders_update_form/'
)
header_value
=
'Orders - Update'
self
.
assertIn
(
'Orders - Update'
,
self
.
browser
.
title
)
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
#test_display_orders_list
self
.
browser
.
get
(
'http://localhost:8000/froyo/orders_create_form/'
)
self
.
browser
.
get
(
'http://localhost:8000/froyo/orders_create_form/'
)
header_value
=
'Orders - Create'
self
.
assertIn
(
'Orders - Create'
,
self
.
browser
.
title
)
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
):
def
test_Fail_Test
(
self
):
self
.
fail
(
'Finished the test!'
)
self
.
fail
(
'Finished the test!'
)
...
...
thegoodplace/templates/ingredients_create_form.html
0 → 100644
View file @
64fe86f9
<html>
<head>
<title>
Ingredients - Create
</title>
</head>
<body>
<h1>
Ingredients - Create
</h1>
</html>
\ No newline at end of file
thegoodplace/templates/ingredients_detail.html
0 → 100644
View file @
64fe86f9
<html>
<head>
<title>
Ingredients - Detail
</title>
</head>
<body>
<h1>
Ingredients - Detail
</h1>
</html>
\ No newline at end of file
thegoodplace/templates/ingredients_list.html
0 → 100644
View file @
64fe86f9
<html>
<head>
<title>
Ingredients - List
</title>
</head>
<body>
<h1>
Ingredients - List
</h1>
</html>
\ No newline at end of file
thegoodplace/templates/ingredients_update_form.html
0 → 100644
View file @
64fe86f9
<html>
<head>
<title>
Ingredients - Update
</title>
</head>
<body>
<h1>
Ingredients - Update
</h1>
</html>
\ No newline at end of file
thegoodplace/templates/recipes_list.html
0 → 100644
View file @
64fe86f9
<html>
<head>
<title>
Recipes - List
</title>
</head>
<body>
<h1>
Recipes - List
</h1>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment