Fakultas Ilmu Komputer UI

Commit c3b23424 authored by Christian Wisnu Purnaadi's avatar Christian Wisnu Purnaadi
Browse files

[#88] Fixing materi view count tests

parent 8ed7190b
Pipeline #60208 passed with stages
in 26 minutes and 2 seconds
......@@ -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 = {}
......
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