'Verify that a user has access to a thread within a given
discussion_id when should_have_access is True, otherwise
verify that the user does not have access to that thread.'

def assert_can_access(self, user, discussion_id, thread_id, should_have_access):

    def call_single_thread():
        self.client.login(username=user.username, password='test')
        return self.client.get(reverse('single_thread', args=[unicode(self.course.id), discussion_id, thread_id]))
    if should_have_access:
        self.assertEqual(call_single_thread().status_code, 200)
    else:
        self.assertEqual(call_single_thread().status_code, 404)
