Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
1
183711-Paguio-PROJECT1
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
Clark Joshua Paguio
183711-Paguio-PROJECT1
Commits
18ed47af
Commit
18ed47af
authored
Mar 17, 2020
by
cj0125
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added URLs. Added functional tests.
parent
d2319e9a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
0 deletions
+111
-0
urls.py
froyo/urls.py
+33
-0
functional_test.py
functional_test.py
+76
-0
manage.py
manage.py
+0
-0
settings.py
thegoodplace/thegoodplace/settings.py
+1
-0
urls.py
thegoodplace/thegoodplace/urls.py
+1
-0
No files found.
froyo/urls.py
0 → 100644
View file @
18ed47af
"""thegoodplace URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from
django.conf.urls
import
url
from
.views
import
IngredientsCreateFormView
,
IngredientsDetailView
,
IngredientsListView
,
IngredientsUpdateFormView
,
OrdersCreateFormView
,
OrdersDetailView
,
OrdersListView
,
OrdersUpdateFormView
,
RecipesCreateFormView
,
RecipesDetailView
,
RecipesListView
,
RecipesUpdateFormView
urlpatterns
=
[
url
(
r'^ingredients_create_form$'
,
IngredientsCreateFormView
.
as_view
(),
name
=
'ICF'
),
url
(
r'^ingredients_detail$'
,
IngredientsDetailView
.
as_view
(),
name
=
'ID'
),
url
(
r'^ingredients_list$'
,
IngredientsListView
.
as_view
(),
name
=
'IL'
),
url
(
r'^ingredients_update_form$'
,
IngredientsUpdateFormView
.
as_view
(),
name
=
'IUF'
),
url
(
r'^orders_create_form$'
,
OrdersCreateFormView
.
as_view
(),
name
=
'OCF'
),
url
(
r'^orders_detail$'
,
OrdersDetailView
.
as_view
(),
name
=
'OD'
),
url
(
r'^orders_list$'
,
OrdersListView
.
as_view
(),
name
=
'OL'
),
url
(
r'^orders_update_form$'
,
OrdersUpdateFormView
.
as_view
(),
name
=
'OUF'
),
url
(
r'^recipes_create_form$'
,
RecipesCreateFormView
.
as_view
(),
name
=
'RCF'
),
url
(
r'^recipes_detail$'
,
RecipesDetailView
.
as_view
(),
name
=
'RD'
),
url
(
r'^recipes_list$'
,
RecipesListView
.
as_view
(),
name
=
'RL'
),
url
(
r'^recipes_update_form$'
,
RecipesUpdateFormView
.
as_view
(),
name
=
'RUF'
),
]
functional_test.py
0 → 100644
View file @
18ed47af
import
unittest
from
selenium
import
webdriver
class
NewVisitorTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
browser
=
webdriver
.
Firefox
()
def
tearDown
(
self
):
self
.
browser
.
quit
()
def
test_display_ICF
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/ingredients_create_form'
)
self
.
assertIn
(
'Ingredients - Create Form'
,
self
.
browser
.
title
)
self
.
assertIn
(
'http://localhost:8000/ingredients_create_form'
,
self
.
browser
.
current_url
)
def
test_display_ID
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/ingredients_detail'
)
self
.
assertIn
(
'Ingredients - Detail'
,
self
.
browser
.
title
)
self
.
assertIn
(
'http://localhost:8000/ingredients_detail'
,
self
.
browser
.
current_url
)
def
test_display_IL
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/ingredients_list'
)
self
.
assertIn
(
'Ingredients - List'
,
self
.
browser
.
title
)
self
.
assertIn
(
'http://localhost:8000/ingredients_list'
,
self
.
browser
.
current_url
)
def
test_display_IUF
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/ingredients_update_form'
)
self
.
assertIn
(
'Ingredients - Update Form'
,
self
.
browser
.
title
)
self
.
assertIn
(
'http://localhost:8000/ingredients_update_form'
,
self
.
browser
.
current_url
)
def
test_display_OCF
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/orders_create_form'
)
self
.
assertIn
(
'Orders - Create Form'
,
self
.
browser
.
title
)
self
.
assertIn
(
'http://localhost:8000/orders_create_form'
,
self
.
browser
.
current_url
)
def
test_display_OD
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/orders_detail'
)
self
.
assertIn
(
'Orders - Detail'
,
self
.
browser
.
title
)
self
.
assertIn
(
'http://localhost:8000/orders_detail'
,
self
.
browser
.
current_url
)
def
test_display_OL
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/orders_list'
)
self
.
assertIn
(
'Orders - List'
,
self
.
browser
.
title
)
self
.
assertIn
(
'http://localhost:8000/orders_list'
,
self
.
browser
.
current_url
)
def
test_display_OUF
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/orders_update_form'
)
self
.
assertIn
(
'Orders - Update Form'
,
self
.
browser
.
title
)
self
.
assertIn
(
'http://localhost:8000/orders_update_form'
,
self
.
browser
.
current_url
)
def
test_display_RCF
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/recipes_create_form'
)
self
.
assertIn
(
'Recipes - Create Form'
,
self
.
browser
.
title
)
self
.
assertIn
(
'http://localhost:8000/recipes_create_form'
,
self
.
browser
.
current_url
)
def
test_display_RD
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/recipes_detail'
)
self
.
assertIn
(
'Recipes - Detail'
,
self
.
browser
.
title
)
self
.
assertIn
(
'http://localhost:8000/recipes_detail'
,
self
.
browser
.
current_url
)
def
test_display_RL
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/recipes_list'
)
self
.
assertIn
(
'Recipes - List'
,
self
.
browser
.
title
)
self
.
assertIn
(
'http://localhost:8000/recipes_list'
,
self
.
browser
.
current_url
)
def
test_display_RUF
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/recipes_update_form'
)
self
.
assertIn
(
'Recipes - Update Form'
,
self
.
browser
.
title
)
self
.
assertIn
(
'http://localhost:8000/recipes_update_form'
,
self
.
browser
.
current_url
)
self
.
fail
(
'Finish the test!'
)
if
__name__
==
'main'
:
unittest
.
main
(
warnings
=
'ignore'
)
thegoodplace/
manage.py
→
manage.py
View file @
18ed47af
File moved
thegoodplace/thegoodplace/settings.py
View file @
18ed47af
...
...
@@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'froyo'
]
MIDDLEWARE
=
[
...
...
thegoodplace/thegoodplace/urls.py
View file @
18ed47af
...
...
@@ -18,4 +18,5 @@ from django.contrib import admin
urlpatterns
=
[
url
(
r'^admin/'
,
admin
.
site
.
urls
),
url
(
r''
,
include
(
'froyo.urls'
)),
]
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