'Verify learner profile page context data.'

def test_context(self):

    request = RequestFactory().get('/url')
    request.user = self.user
    context = learner_profile_context(request, self.USERNAME, self.user.is_staff)
    self.assertEqual(context['data']['default_public_account_fields'], settings.ACCOUNT_VISIBILITY_CONFIGURATION['public_fields'])
    self.assertEqual(context['data']['accounts_api_url'], reverse('accounts_api', kwargs={'username': self.user.username}))
    self.assertEqual(context['data']['preferences_api_url'], reverse('preferences_api', kwargs={'username': self.user.username}))
    self.assertEqual(context['data']['profile_image_upload_url'], reverse('profile_image_upload', kwargs={'username': self.user.username}))
    self.assertEqual(context['data']['profile_image_remove_url'], reverse('profile_image_remove', kwargs={'username': self.user.username}))
    self.assertEqual(context['data']['profile_image_max_bytes'], settings.PROFILE_IMAGE_MAX_BYTES)
    self.assertEqual(context['data']['profile_image_min_bytes'], settings.PROFILE_IMAGE_MIN_BYTES)
    self.assertEqual(context['data']['account_settings_page_url'], reverse('account_settings'))
    for attribute in self.CONTEXT_DATA:
        self.assertIn(attribute, context['data'])
