'Test for lms view.'

@ddt.data((True, False, False), (False, True, False), (False, False, True))
def test_student_perms_are_correct(self, permissions):

    permission_dict = {'create_thread': permissions[0], 'create_comment': permissions[1], 'create_sub_comment': permissions[2]}
    self.block.has_permission = (lambda perm: permission_dict[perm])
    fragment = self.block.student_view()
    read_only = ('false' if permissions[0] else 'true')
    self.assertIn('data-discussion-id="{}"'.format(self.discussion_id), fragment.content)
    self.assertIn('data-user-create-comment="{}"'.format(json.dumps(permissions[1])), fragment.content)
    self.assertIn('data-user-create-subcomment="{}"'.format(json.dumps(permissions[2])), fragment.content)
    self.assertIn('data-read-only="{read_only}"'.format(read_only=read_only), fragment.content)
