'Tests custom template search if we have a single template for a course mode.
This test should check template matching when org=null, course=Null, mode={mode}.'

@override_settings(FEATURES=FEATURES_WITH_CUSTOM_CERTS_ENABLED)
def test_certificate_custom_template_with_course_mode(self):

    mode = 'honor'
    self._add_course_certificates(count=1, signatory_count=2)
    self._create_custom_template(mode=mode)
    test_url = get_certificate_url(user_id=self.user.id, course_id=unicode(self.course.id))
    with patch('certificates.api.get_course_organizations') as mock_get_orgs:
        mock_get_orgs.return_value = []
        response = self.client.get(test_url)
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, 'mode:    {}'.format(mode))
