Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thegoodplace-Laguesma
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
Cian Laguesma
thegoodplace-Laguesma
Commits
f0b85398
Commit
f0b85398
authored
Mar 20, 2020
by
cianlaguesma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed views and urls
parent
377eb7bd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
52 deletions
+52
-52
urls.py
froyo/urls.py
+13
-13
views.py
froyo/views.py
+27
-27
functional_tests.py
functional_tests.py
+12
-12
No files found.
froyo/urls.py
View file @
f0b85398
from
django.conf.urls
import
url
from
django.conf.urls
import
url
from
.views
import
ingredients_list
,
ingredients_detail
,
ingredients_update_form
,
ingredients_create_form
,
recipes_list
,
recipes_detail
,
recipes_update_form
,
recipes_create_form
,
orders_list
,
orders_detail
,
orders_update_form
,
orders_create_form
,
home_page
from
.views
import
ingredients_list
,
ingredients_detail
,
ingredients_update_form
,
ingredients_create_form
,
recipes_list
,
recipes_detail
,
recipes_update_form
,
recipes_create_form
,
orders_list
,
orders_detail
,
orders_update_form
,
orders_create_form
,
home_page
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^index$'
,
home_page
,
name
=
'home_page'
),
url
(
r'^index$'
,
home_page
.
as_view
()
,
name
=
'home_page'
),
url
(
r'^ingredients/list$'
,
ingredients_list
,
name
=
'ingredients_list'
),
url
(
r'^ingredients/list$'
,
ingredients_list
.
as_view
()
,
name
=
'ingredients_list'
),
url
(
r'^ingredients/detail$'
,
ingredients_detail
,
name
=
'ingredients_detail'
),
url
(
r'^ingredients/detail$'
,
ingredients_detail
.
as_view
()
,
name
=
'ingredients_detail'
),
url
(
r'^ingredients/update_form$'
,
ingredients_update_form
,
name
=
'ingredients_update_form'
),
url
(
r'^ingredients/update_form$'
,
ingredients_update_form
.
as_view
()
,
name
=
'ingredients_update_form'
),
url
(
r'^ingredients/create_form$'
,
ingredients_create_form
,
name
=
'ingredients_create_form'
),
url
(
r'^ingredients/create_form$'
,
ingredients_create_form
.
as_view
()
,
name
=
'ingredients_create_form'
),
url
(
r'^recipes/list$'
,
recipes_list
,
name
=
'recipes_list'
),
url
(
r'^recipes/list$'
,
recipes_list
.
as_view
()
,
name
=
'recipes_list'
),
url
(
r'^recipes/detail$'
,
recipes_detail
,
name
=
'recipes_detail'
),
url
(
r'^recipes/detail$'
,
recipes_detail
.
as_view
()
,
name
=
'recipes_detail'
),
url
(
r'^recipes/update_form$'
,
recipes_update_form
,
name
=
'recipes_update_form'
),
url
(
r'^recipes/update_form$'
,
recipes_update_form
.
as_view
()
,
name
=
'recipes_update_form'
),
url
(
r'^recipes/create_form$'
,
recipes_create_form
,
name
=
'recipes_create_form'
),
url
(
r'^recipes/create_form$'
,
recipes_create_form
.
as_view
()
,
name
=
'recipes_create_form'
),
url
(
r'^orders/list$'
,
orders_list
,
name
=
'orders_list'
),
url
(
r'^orders/list$'
,
orders_list
.
as_view
()
,
name
=
'orders_list'
),
url
(
r'^orders/detail$'
,
orders_detail
,
name
=
'orders_detail'
),
url
(
r'^orders/detail$'
,
orders_detail
.
as_view
()
,
name
=
'orders_detail'
),
url
(
r'^orders/update_form$'
,
orders_update_form
,
name
=
'orders_update_form'
),
url
(
r'^orders/update_form$'
,
orders_update_form
.
as_view
()
,
name
=
'orders_update_form'
),
url
(
r'^orders/create_form$'
,
orders_create_form
,
name
=
'recipes_create_form'
),
url
(
r'^orders/create_form$'
,
orders_create_form
.
as_view
()
,
name
=
'recipes_create_form'
),
]
]
froyo/views.py
View file @
f0b85398
from
django.
shortcuts
import
render
from
django.
views.generic.base
import
TemplateView
def
home_page
(
request
):
class
home_page
(
TemplateView
):
return
render
(
request
,
'index.html'
)
template_name
=
'index.html'
def
ingredients_list
(
request
):
class
ingredients_list
(
TemplateView
):
return
render
(
request
,
'ingredients_list.html'
)
template_name
=
'ingredients_list.html'
def
ingredients_detail
(
request
):
class
ingredients_detail
(
TemplateView
):
return
render
(
request
,
'ingredients_detail.html'
)
template_name
=
'ingredients_detail.html'
def
ingredients_update_form
(
request
):
class
ingredients_update_form
(
TemplateView
):
return
render
(
request
,
'ingredients_update_form.html'
)
template_name
=
'ingredients_update_form.html'
def
ingredients_create_form
(
request
):
class
ingredients_create_form
(
TemplateView
):
return
render
(
request
,
'ingredients_create_form.html'
)
template_name
=
'ingredients_create_form.html'
def
recipes_list
(
request
):
class
recipes_list
(
TemplateView
):
return
render
(
request
,
'recipes_list.html'
)
template_name
=
'recipes_list.html'
def
recipes_detail
(
request
):
class
recipes_detail
(
TemplateView
):
return
render
(
request
,
'recipes_detail.html'
)
template_name
=
'recipes_detail.html'
def
recipes_update_form
(
request
):
class
recipes_update_form
(
TemplateView
):
return
render
(
request
,
'recipes_update_form.html'
)
template_name
=
'recipes_update_form.html'
def
recipes_create_form
(
request
):
class
recipes_create_form
(
TemplateView
):
return
render
(
request
,
'recipes_create_form.html'
)
template_name
=
'recipes_create_form.html'
def
orders_list
(
request
):
class
orders_list
(
TemplateView
):
return
render
(
request
,
'orders_list.html'
)
template_name
=
'orders_list.html'
def
orders_detail
(
request
):
class
orders_detail
(
TemplateView
):
return
render
(
request
,
'orders_detail.html'
)
template_name
=
'orders_detail.html'
def
orders_update_form
(
request
):
class
orders_update_form
(
TemplateView
):
return
render
(
request
,
'orders_update_form.html'
)
template_name
=
'orders_update_form.html'
def
orders_create_form
(
request
):
class
orders_create_form
(
TemplateView
):
return
render
(
request
,
'orders_create_form.html'
)
template_name
=
'orders_create_form.html'
# Create your views here.
# Create your views here.
functional_tests.py
View file @
f0b85398
...
@@ -61,7 +61,7 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -61,7 +61,7 @@ class NewVisitorTest(unittest.TestCase):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
assertEqual
(
'http://localhost:8000/ingredients/detail'
,
self
.
browser
.
current_url
)
self
.
assertEqual
(
'http://localhost:8000/ingredients/detail'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"ingredients_detail_header"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"ingredients_detail_header"
))
# After
Updating the ingredient
, he went back home
# After
this
, he went back home
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
home
.
click
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
@@ -79,7 +79,7 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -79,7 +79,7 @@ class NewVisitorTest(unittest.TestCase):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
assertEqual
(
'http://localhost:8000/ingredients/list'
,
self
.
browser
.
current_url
)
self
.
assertEqual
(
'http://localhost:8000/ingredients/list'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"ingredients_list_header"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"ingredients_list_header"
))
# After
Updating the ingredient
, he went back home
# After
this
, he went back home
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
home
.
click
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
@@ -96,7 +96,7 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -96,7 +96,7 @@ class NewVisitorTest(unittest.TestCase):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
assertEqual
(
'http://localhost:8000/orders/create_form'
,
self
.
browser
.
current_url
)
self
.
assertEqual
(
'http://localhost:8000/orders/create_form'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"orders_create_form_header"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"orders_create_form_header"
))
# After
Updating the ingredient
, he went back home
# After
creating the form
, he went back home
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
home
.
click
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
@@ -114,8 +114,8 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -114,8 +114,8 @@ class NewVisitorTest(unittest.TestCase):
update_order
.
click
()
update_order
.
click
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
assertEqual
(
'http://localhost:8000/orders/update_form'
,
self
.
browser
.
current_url
)
self
.
assertEqual
(
'http://localhost:8000/orders/update_form'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"orders_
cre
ate_form_header"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"orders_
upd
ate_form_header"
))
# After Updating the
ingredient
, he went back home
# After Updating the
order
, he went back home
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
home
.
click
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
@@ -126,7 +126,7 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -126,7 +126,7 @@ class NewVisitorTest(unittest.TestCase):
def
test_froyo_display_detail_orders
(
self
):
def
test_froyo_display_detail_orders
(
self
):
#He also wanted to look at the detail of a record for an orderso he went and looked at one and he noticed the header Orders - Detail
#He also wanted to look at the detail of a record for an order
so he went and looked at one and he noticed the header Orders - Detail
self
.
browser
.
get
(
'http://localhost:8000/index'
)
self
.
browser
.
get
(
'http://localhost:8000/index'
)
...
@@ -135,7 +135,7 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -135,7 +135,7 @@ class NewVisitorTest(unittest.TestCase):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
assertEqual
(
'http://localhost:8000/orders/detail'
,
self
.
browser
.
current_url
)
self
.
assertEqual
(
'http://localhost:8000/orders/detail'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"orders_detail_header"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"orders_detail_header"
))
# After
Updating the ingredient
, he went back home
# After
this
, he went back home
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
home
.
click
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
@@ -153,7 +153,7 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -153,7 +153,7 @@ class NewVisitorTest(unittest.TestCase):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
assertEqual
(
'http://localhost:8000/orders/list'
,
self
.
browser
.
current_url
)
self
.
assertEqual
(
'http://localhost:8000/orders/list'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"orders_list_header"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"orders_list_header"
))
# After
Updating the ingredient
, he went back home
# After
this
, he went back home
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
home
.
click
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
@@ -170,7 +170,7 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -170,7 +170,7 @@ class NewVisitorTest(unittest.TestCase):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
assertEqual
(
'http://localhost:8000/recipes/create_form'
,
self
.
browser
.
current_url
)
self
.
assertEqual
(
'http://localhost:8000/recipes/create_form'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"recipes_create_form_header"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"recipes_create_form_header"
))
# After
Updating the ingredient
, he went back home
# After
this
, he went back home
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
home
.
click
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
@@ -187,7 +187,7 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -187,7 +187,7 @@ class NewVisitorTest(unittest.TestCase):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
assertEqual
(
'http://localhost:8000/recipes/update_form'
,
self
.
browser
.
current_url
)
self
.
assertEqual
(
'http://localhost:8000/recipes/update_form'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"recipes_update_form_header"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"recipes_update_form_header"
))
# After
Updating the ingredient
, he went back home
# After
this
, he went back home
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
home
.
click
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
@@ -204,7 +204,7 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -204,7 +204,7 @@ class NewVisitorTest(unittest.TestCase):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
assertEqual
(
'http://localhost:8000/recipes/detail'
,
self
.
browser
.
current_url
)
self
.
assertEqual
(
'http://localhost:8000/recipes/detail'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"recipes_detail_header"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"recipes_detail_header"
))
# After
Updating the ingredient
, he went back home
# After
this
, he went back home
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
home
.
click
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
@@ -221,7 +221,7 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -221,7 +221,7 @@ class NewVisitorTest(unittest.TestCase):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
assertEqual
(
'http://localhost:8000/recipes/list'
,
self
.
browser
.
current_url
)
self
.
assertEqual
(
'http://localhost:8000/recipes/list'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"recipes_list_header"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"recipes_list_header"
))
# After
Updating the ingredient
, he went back home
# After
this
, he went back home
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
home
.
click
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
...
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