'Tests thread has user profile image details if called in requested_fields'

def test_profile_image_requested_field(self):

    self.register_get_user_response(self.user)
    cs_thread = make_minimal_cs_thread({u'id': self.thread_id, u'course_id': unicode(self.course.id), u'username': self.user.username, u'user_id': str(self.user.id)})
    self.register_get_thread_response(cs_thread)
    self.create_profile_image(self.user, get_profile_image_storage())
    response = self.client.get(self.url, {u'requested_fields': u'profile_image'})
    self.assertEqual(response.status_code, 200)
    expected_profile_data = self.get_expected_user_profile(self.user.username)
    response_users = json.loads(response.content)[u'users']
    self.assertEqual(expected_profile_data, response_users[self.user.username])
