Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jelle van der Waa
Archweb
Commits
692d80d7
Commit
692d80d7
authored
Mar 25, 2018
by
Jelle van der Waa
🚧
Browse files
todolists: Add test for overview and detail page
parent
d8977b24
Changes
1
Hide whitespace changes
Inline
Side-by-side
todolists/tests/test_views.py
0 → 100644
View file @
692d80d7
from
django.contrib.auth.models
import
User
from
django.test
import
TestCase
from
todolists.models
import
Todolist
class
TestTodolist
(
TestCase
):
fixtures
=
[
'main/fixtures/arches.json'
,
'main/fixtures/repos.json'
,
'main/fixtures/package.json'
]
def
setUp
(
self
):
self
.
user
=
User
.
objects
.
create
(
username
=
"joeuser"
,
first_name
=
"Joe"
,
last_name
=
"User"
,
email
=
"user1@example.com"
)
self
.
todolist
=
Todolist
.
objects
.
create
(
name
=
'Boost rebuild'
,
description
=
'Boost 1.66 rebuid'
,
creator
=
self
.
user
,
slug
=
'boost-rebuild'
,
raw
=
'linux'
)
def
test_todolist_overview
(
self
):
response
=
self
.
client
.
get
(
'/todo/'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertIn
(
self
.
todolist
.
name
,
response
.
content
)
def
test_todolist_detail
(
self
):
response
=
self
.
client
.
get
(
self
.
todolist
.
get_absolute_url
())
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertIn
(
self
.
todolist
.
name
,
response
.
content
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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