Add pagination to forum user profile page
This commit is contained in:
@@ -299,8 +299,8 @@ class UserProfileTestCase(ModuleStoreTestCase):
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
|
||||
html = response.content
|
||||
self.assertRegexpMatches(html, r'var \$\$course_id = \"{}\"'.format(self.course.id))
|
||||
self.assertRegexpMatches(html, r'var \$\$profiled_user_id = \"{}\"'.format(self.profiled_user.id))
|
||||
self.assertRegexpMatches(html, r'data-page="1"')
|
||||
self.assertRegexpMatches(html, r'data-num-pages="1"')
|
||||
self.assertRegexpMatches(html, r'<span>1</span> discussion started')
|
||||
self.assertRegexpMatches(html, r'<span>2</span> comments')
|
||||
self.assertRegexpMatches(html, r'"id": "{}"'.format(self.TEST_THREAD_ID))
|
||||
|
||||
@@ -353,6 +353,8 @@ def user_profile(request, course_id, user_id):
|
||||
'threads': saxutils.escape(json.dumps(threads), escapedict),
|
||||
'user_info': saxutils.escape(json.dumps(user_info), escapedict),
|
||||
'annotated_content_info': saxutils.escape(json.dumps(annotated_content_info), escapedict),
|
||||
'page': query_params['page'],
|
||||
'num_pages': query_params['num_pages'],
|
||||
# 'content': content,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user