Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thegoodplace
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
Cidney P. Ciacho
thegoodplace
Commits
9942417a
Commit
9942417a
authored
Mar 20, 2020
by
Cidney P. Ciacho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created tests, will check for errors.
parent
48bb8cc1
Pipeline
#1140
canceled with stages
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
158 additions
and
4 deletions
+158
-4
db.sqlite3
db.sqlite3
+0
-0
tests.py
froyo/tests.py
+83
-1
urls.py
froyo/urls.py
+21
-0
views.py
froyo/views.py
+50
-2
settings.py
thegoodplace/settings.py
+2
-0
urls.py
thegoodplace/urls.py
+2
-1
No files found.
db.sqlite3
0 → 100644
View file @
9942417a
File added
froyo/tests.py
View file @
9942417a
from
django.test
import
TestCase
from
django.test
import
TestCase
# Create your tests here.
class
IngListTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'ingredients_list'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_list.html'
)
class
IngDetailTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'ingredients_detail'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_detail.html'
)
class
IngUpdateTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'ingredients_update_form'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_update_form.html'
)
class
IngCreateTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'ingredients_create_form'
)
self
.
assertTemplateUsed
(
response
,
'ingredients_create_form.html'
)
class
RecipesListTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'recipes_list'
)
self
.
assertTemplateUsed
(
response
,
'recipes_list.html'
)
class
RecipesDetailTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'recipes_detail'
)
self
.
assertTemplateUsed
(
response
,
'recipes_detail.html'
)
class
RecipesUpdateTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'recipes_update_form'
)
self
.
assertTemplateUsed
(
response
,
'recipes_update_form.html'
)
class
RecipesCreateTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'recipes_create_form'
)
self
.
assertTemplateUsed
(
response
,
'recipes_create_form.html'
)
class
OrdersListTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'orders_list'
)
self
.
assertTemplateUsed
(
response
,
'orders_list.html'
)
class
OrdersDetailTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'orders_detail'
)
self
.
assertTemplateUsed
(
response
,
'orders_detail.html'
)
class
OrdersUpdateTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'orders_update_form'
)
self
.
assertTemplateUsed
(
response
,
'orders_update_form.html'
)
class
OrdersCreateTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'orders_create_form'
)
self
.
assertTemplateUsed
(
response
,
'orders_create_form.html'
)
\ No newline at end of file
froyo/urls.py
0 → 100644
View file @
9942417a
from
django.conf.urls
import
url
from
.views
import
IngListView
,
IngDetailView
,
IngUpdateView
,
IngCreateView
,
RecipesListView
,
RecipesDetailView
,
RecipesUpdateView
,
RecipesCreateView
,
OrdersListView
,
OrdersDetailView
,
OrdersUpdateView
,
OrdersCreateView
urlpatterns
=
[
url
(
r'^ingredients_list$'
,
IngListView
.
as_view
(),
name
=
'ingredients_list'
),
url
(
r'^ingredients_detail$'
,
IngDetailView
.
as_view
(),
name
=
'ingredients_detail'
),
url
(
r'^ingredients_update_form$'
,
IngUpdateView
.
as_view
(),
name
=
'ingredients_update_form'
),
url
(
r'^ingredients_create_form$'
,
IngCreateView
.
as_view
(),
name
=
'ingredients_create_form'
),
url
(
r'^recipes_list$'
,
RecipesListView
.
as_view
(),
name
=
'recipes_list'
),
url
(
r'^recipes_detail$'
,
RecipesDetailView
.
as_view
(),
name
=
'recipes_detail'
),
url
(
r'^recipes_update_form$'
,
RecipesUpdateView
.
as_view
(),
name
=
'recipes_update_form'
),
url
(
r'^recipes_create_form$'
,
RecipesCreateView
.
as_view
(),
name
=
'recipes_create_form'
),
url
(
r'^orders_list$'
,
OrdersListView
.
as_view
(),
name
=
'orders_list'
),
url
(
r'^orders_detail$'
,
OrdersDetailView
.
as_view
(),
name
=
'orders_detail'
),
url
(
r'^orders_update_form$'
,
OrdersUpdateView
.
as_view
(),
name
=
'orders_update_form'
),
url
(
r'^orders_create_form$'
,
OrdersCreateView
.
as_view
(),
name
=
'orders_create_form'
)
]
\ No newline at end of file
froyo/views.py
View file @
9942417a
from
django.shortcuts
import
render
from
django.views.generic.base
import
TemplateView
class
IngListView
(
TemplateView
):
template_name
=
'ingredients_list.html'
class
IngDetailView
(
TemplateView
):
template_name
=
'ingredients_detail.html'
class
IngUpdateView
(
TemplateView
):
template_name
=
' ingredients_update_form.html'
class
IngCreateView
(
TemplateView
):
template_name
=
'ingredients_create_form.html'
class
RecipesListView
(
TemplateView
):
template_name
=
'recipes_list.html'
class
RecipesDetailView
(
TemplateView
):
template_name
=
'recipes_detail.html'
# Create your views here.
class
RecipesUpdateView
(
TemplateView
):
template_name
=
'recipes_update_form.html'
class
RecipesCreateView
(
TemplateView
):
template_name
=
'recipes_create_form.html'
class
OrdersListView
(
TemplateView
):
template_name
=
' orders_list.html'
class
OrdersDetailView
(
TemplateView
):
template_name
=
'orders_detail.html'
class
OrdersUpdateView
(
TemplateView
):
template_name
=
'orders_update_form.html'
class
OrdersCreateView
(
TemplateView
):
template_name
=
'orders_create_form.html'
from
django.shortcuts
import
render
\ No newline at end of file
thegoodplace/settings.py
View file @
9942417a
...
@@ -37,6 +37,8 @@ INSTALLED_APPS = [
...
@@ -37,6 +37,8 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'django.contrib.staticfiles'
,
'froyo'
,
'selenium'
,
]
]
MIDDLEWARE
=
[
MIDDLEWARE
=
[
...
...
thegoodplace/urls.py
View file @
9942417a
...
@@ -13,9 +13,10 @@ Including another URLconf
...
@@ -13,9 +13,10 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
"""
from
django.conf.urls
import
url
from
django.conf.urls
import
url
,
include
from
django.contrib
import
admin
from
django.contrib
import
admin
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^admin/'
,
admin
.
site
.
urls
),
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