Fakultas Ilmu Komputer UI

Commit 3bb4735a authored by Nurma Ayu Wigati S. Subroto's avatar Nurma Ayu Wigati S. Subroto

Merge branch '1906438014-46' into 'master'

[#46] Delete Rating

See merge request !116
parents a987c69c 43bb4812
Pipeline #60725 passed with stages
in 20 minutes and 36 seconds
......@@ -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 %}
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment