def test_renders_503(self, pyramid_config, pyramid_request): renderer = pyramid_config.testing_add_renderer("503.html") renderer.string_response = "A 503 Error" resp = service_unavailable(pretend.stub(), pyramid_request) assert resp.status_code == 503 assert resp.content_type == "text/html" assert resp.body == b"A 503 Error"