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
43bb4812
Commit
43bb4812
authored
Nov 18, 2020
by
Nurma Ayu Wigati S. Subroto
Browse files
[
#46
] Delete Rating
parent
a987c69c
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/templates/given-rating.html
View file @
43bb4812
...
...
@@ -100,7 +100,8 @@
<td>
{{ i.timestamp }}
</td>
<td>
{{ i.score }}
</td>
<td>
<a
href=
"/edit/{{ i.score }}"
><span
class=
"glyphicon glyphicon-pencil"
>
Edit
</span></a>
<a
href=
"/edit/{{ i.score }}"
><span
class=
"glyphicon glyphicon-pencil"
>
Edit
</span></a>
<a
href=
"/delete/{{ i.score }}"
><span
class=
"glyphicon glyphicon-pencil"
>
Delete
</span></a>
</td>
</tr>
{% endfor %}
...
...
app/tests.py
View file @
43bb4812
...
...
@@ -2342,6 +2342,13 @@ class RatingMateriTest(TestCase):
def
test_rating_materi_url_use_edit_rating_materi_function
(
self
):
found
=
resolve
(
self
.
url_rate
)
self
.
assertEqual
(
found
.
func
,
add_rating_materi
)
def
test_rating_materi_url_use_delete_rating_materi_function
(
self
):
response
=
self
.
client
.
get
(
self
.
url_rate
)
response_json
=
json
.
loads
(
response
.
content
)
self
.
assertEqual
(
response_json
.
get
(
"success"
,
None
),
False
)
self
.
assertEqual
(
response_json
.
get
(
"msg"
,
None
),
"Forbidden"
)
self
.
assertEqual
(
response
.
status_code
,
403
)
def
test_rating_materi_get_method_should_return_403_forbidden
(
self
):
response
=
self
.
client
.
get
(
self
.
url_rate
)
...
...
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