Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Collection of Practice
2019
1606835595-practice
Commits
69800cdb
Commit
69800cdb
authored
Sep 25, 2019
by
Kevin Albert Simanjuntak
Browse files
[red] implement comment testing in test.py
parent
effb20c4
Pipeline
#20852
failed with stage
in 1 minute and 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lists/tests.py
View file @
69800cdb
...
...
@@ -49,6 +49,17 @@ class HomePageTest(TestCase):
self
.
assertIn
(
'itemey 1'
,
response
.
content
.
decode
())
self
.
assertIn
(
'itemey 2'
,
response
.
content
.
decode
())
def
test_displays_comment
(
self
):
response
=
self
.
client
.
get
(
'/homepage/'
)
self
.
assertIn
(
'<h2 id="comment">yey, waktunya berlibur</h2>'
,
response
.
content
.
decode
())
Item
.
objects
.
create
(
text
=
'itemey 1'
)
Item
.
objects
.
create
(
text
=
'itemey 2'
)
self
.
assertIn
(
'<h2 id="comment">sibuk tapi santai</h2>'
,
response
.
content
.
decode
())
Item
.
objects
.
create
(
text
=
'itemey 3'
)
Item
.
objects
.
create
(
text
=
'itemey 4'
)
Item
.
objects
.
create
(
text
=
'itemey 5'
)
self
.
assertIn
(
'<h2 id="comment">oh tidak</h2>'
,
response
.
content
.
decode
())
class
ItemModelTest
(
TestCase
):
def
test_saving_and_retrieving_items
(
self
):
...
...
Write
Preview
Supports
Markdown
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