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

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

    self._add_course_certificates(count=1, signatory_count=2)
    self._create_custom_template(org_id=1, mode='honor')
    self._create_custom_template(org_id=1, mode='honor', course_key=self.course.id)
    self._create_custom_template(org_id=2)
    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.side_effect = [[{'id': 2, 'name': 'organization    name    2'}]]
        response = self.client.get(test_url)
        self.assertEqual(response.status_code, 200)
