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
Class Project
DIGIPUS
Commits
c3b23424
Commit
c3b23424
authored
Nov 04, 2020
by
Christian Wisnu Purnaadi
Browse files
[
#88
] Fixing materi view count tests
parent
8ed7190b
Pipeline
#60208
passed with stages
in 26 minutes and 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/tests.py
View file @
c3b23424
...
...
@@ -602,11 +602,6 @@ class DetailMateriTest(TestCase):
url
,
{
"comment"
:
"This is new comment by Contributor"
})
response
=
self
.
client
.
get
(
url
)
self
.
assertContains
(
response
,
"Komentar (2)"
)
def
test_detail_materi_contain_view_count
(
self
):
self
.
client
.
login
(
**
self
.
contributor_credential
)
response
=
self
.
client
.
get
(
self
.
url
)
self
.
assertContains
(
response
,
"Telah dilihat :"
)
def
test_detail_materi_contains_form_comment
(
self
):
self
.
client
.
login
(
**
self
.
contributor_credential
)
...
...
@@ -814,6 +809,16 @@ class DetailMateriTest(TestCase):
mock_upload_to_gdrive
.
assert_called_once
()
self
.
assertEqual
(
last_url
,
'/materi/%d/'
%
self
.
materi1
.
id
)
self
.
assertEqual
(
status_code
,
302
)
def
test_view_count_is_in_init_context
(
self
):
context
=
{}
DetailMateriService
.
init_materi_view_count
(
context
,
self
.
materi1
)
self
.
assertIn
(
'materi_view_count'
,
context
.
keys
())
def
test_view_count_is_integer
(
self
):
context
=
{}
DetailMateriService
.
init_materi_view_count
(
context
,
self
.
materi1
)
self
.
assertEqual
(
type
(
context
[
'materi_view_count'
]),
int
)
def
test_download_count_is_in_init_context
(
self
):
context
=
{}
...
...
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