'Test that links from CertificateHtmlViewConfiguration are used if
corresponding microsite or marketing urls are not present.'

@override_settings(FEATURES=FEATURES_WITH_CERTS_ENABLED)
@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_certificate_without_branding_urls(self):

    self._add_course_certificates(count=1, signatory_count=1, is_active=True)
    self.course.save()
    self.store.update_item(self.course, self.user.id)
    configuration = CertificateHtmlViewConfiguration.get_config()
    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.assertContains(response, configuration['microsites']['test-site']['company_about_url'])
    self.assertContains(response, configuration['microsites']['test-site']['company_privacy_url'])
    self.assertContains(response, configuration['microsites']['test-site']['company_tos_url'])
