Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Collection of Practice
2019
1606885025-practice
Commits
55481f85
Commit
55481f85
authored
Nov 07, 2019
by
Rani Lasma Uli
Browse files
fix test to kill mutant
parent
de601397
Changes
1
Hide whitespace changes
Inline
Side-by-side
lists/tests/test_views.py
View file @
55481f85
...
...
@@ -25,7 +25,6 @@ class ListViewTest(TestCase):
def
test_can_save_a_POST_request
(
self
):
response
=
self
.
client
.
post
(
TO_DO_LIST_URL
,
data
=
{
'item_text'
:
'A new list item'
})
self
.
assertEqual
(
Item
.
objects
.
count
(),
1
)
new_item
=
Item
.
objects
.
first
()
self
.
assertEqual
(
new_item
.
text
,
'A new list item'
)
...
...
@@ -37,6 +36,11 @@ class ListViewTest(TestCase):
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
response
[
'location'
],
TO_DO_LIST_URL
)
def
test_GET_will_return_ok_response
(
self
):
response
=
self
.
client
.
get
(
TO_DO_LIST_URL
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertFalse
(
'location'
in
response
)
def
test_only_saves_items_when_necessary
(
self
):
self
.
client
.
get
(
TO_DO_LIST_URL
)
self
.
assertEqual
(
Item
.
objects
.
count
(),
0
)
...
...
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