Fakultas Ilmu Komputer UI

Commit 1e49ee1b authored by Azhar Rais's avatar Azhar Rais
Browse files

[REFACTOR] Make pagination_html a function instead of lambda

parent ad6b3e41
Pipeline #59983 passed with stages
in 12 minutes and 43 seconds
......@@ -165,6 +165,10 @@ class DiscussionCommentModelTest(TestCase):
self.assertEqual(discussion_comment.materi.count(), 2)
def pagination_html(page):
return '<li class="page-item"><a class="page-link" href="?page={}">{}</a></li>'.format(page, page)
class ForumHomePageTest(TestCase):
def setUp(self):
self.USER_CONTRIBUTOR = User.objects.create_contributor(email=CONTRIBUTOR_EMAIL, password=CONTRIBUTOR_PASSWORD)
......@@ -203,8 +207,6 @@ class ForumHomePageTest(TestCase):
self.assertIn("User Test", request.content.decode())
def test_forum_home_pagination(self):
pagination_html = lambda page: '<li class="page-item"><a class="page-link" href="?page={}">{}</a></li>' \
.format(page, page)
for i in range(51):
num = str(i)
Discussion.objects.create(title="Discussion " + num, description="Description " + num,
......@@ -285,9 +287,6 @@ class ForumDiscussionDetailPageTest(TestCase):
def test_discussion_detail_page_pagination(self):
discussion_id = str(self.DISCUSSION.id)
pagination_html = lambda page: '<li class="page-item"><a class="page-link" href="?page={}">{}</a></li>' \
.format(page, page)
data = []
for i in range(101):
data.append(DiscussionComment(description="Description " + str(i), user=self.USER_CONTRIBUTOR,
......
Supports Markdown
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