'Tests at least one data item from different context update methods to
make sure every context update method is invoked while rendering certificate template.'

@override_settings(FEATURES=FEATURES_WITH_BADGES_ENABLED)
@patch.dict('django.conf.settings.SOCIAL_SHARING_SETTINGS', {'CERTIFICATE_TWITTER': True, 'CERTIFICATE_FACEBOOK': True})
@patch.dict('django.conf.settings.MICROSITE_CONFIGURATION', {'test_site': dict(settings.MICROSITE_CONFIGURATION['test_site'], urls=dict(ABOUT=None, PRIVACY=None, TOS_AND_HONOR=None))})
@patch.dict('django.conf.settings.MKTG_URL_LINK_MAP', {'ABOUT': None, 'PRIVACY': None, 'TOS_AND_HONOR': None})
def test_rendering_maximum_data(self):

    long_org_name = 'Long    org    name'
    short_org_name = 'short_org_name'
    test_organization_data = {'name': long_org_name, 'short_name': short_org_name, 'description': 'Test    Organization    Description', 'active': True, 'logo': '/logo_test1.png'}
    test_org = organizations_api.add_organization(organization_data=test_organization_data)
    organizations_api.add_organization_course(organization_data=test_org, course_id=unicode(self.course.id))
    self._add_course_certificates(count=1, signatory_count=1, is_active=True)
    badge_class = get_completion_badge(course_id=self.course_id, user=self.user)
    BadgeAssertionFactory.create(user=self.user, badge_class=badge_class)
    self.course.cert_html_view_overrides = {'logo_src': '/static/certificates/images/course_override_logo.png'}
    self.course.save()
    self.store.update_item(self.course, self.user.id)
    test_url = get_certificate_url(user_id=self.user.id, course_id=unicode(self.course.id))
    response = self.client.get(test_url, HTTP_HOST=settings.MICROSITE_TEST_HOSTNAME)
    self.assertIn('Terms    of    Service    &amp;    Honor    Code', response.content)
    self.assertIn('Certificate    ID    Number', response.content)
    self.assertIn('<a    class="logo"    href="http://test_site.localhost">', response.content)
    self.assertIn('course_title_0', response.content)
    self.assertIn('{fullname},    you    earned    a    certificate!'.format(fullname=self.user.profile.name), response.content)
    self.assertIn('Post    on    Facebook', response.content)
    self.assertIn('Share    on    Twitter', response.content)
    self.assertIn('a    course    of    study    offered    by    {partner_short_name},    an    online    learning    initiative    of    {partner_long_name}.'.format(partner_short_name=short_org_name, partner_long_name=long_org_name), response.content)
    self.assertIn('Add    to    Mozilla    Backpack', response.content)
    self.assertIn('http://www.test-site.org/about-us', response.content)
    self.assertIn('/static/certificates/images/course_override_logo.png', response.content)
