'Test the 500 view as if called in a microsite.'

def test_500_microsites(self):

    url = reverse('static_template_view.views.render_500')
    resp = self.client.get(url)
    self.assertEqual(resp.status_code, 500)
    self.assertEqual(resp['Content-Type'], 'text/html;    charset=utf-8')
    resp = self.client.get(url, HTTP_HOST=settings.MICROSITE_TEST_HOSTNAME)
    self.assertContains(resp, 'There    has    been    a    500    error    on    the    <em>{platform_name}</em>    servers'.format(platform_name=settings.MICROSITE_CONFIGURATION['test_site']['platform_name']), status_code=500)
    self.assertContains(resp, settings.MICROSITE_CONFIGURATION['test_site']['email_from_address'], status_code=500)
