def acidentes_sexo(request):
    """ Return the render with the statistics from
    involved in the accident by gender. """
    try:
        people_dao = PessoasAcidentesDAO()
        men_year = people_dao.acidentes_por_sexo_e_ano("M")
        women_year = people_dao.acidentes_por_sexo_e_ano("F")
        men_general = people_dao.acidentes_por_sexo_geral("M")
        women_general = people_dao.acidentes_por_sexo_geral("F")
        men_general, women_general = media_sexo(men_general, women_general)

    except (MySQLdb.Error, ResultadoConsultaNuloError):
        # logger.error(str(e))
        erro = "Ocorreu um erro no sistema, tente novamente mais tarde!"
        response = render_to_response("index.html", {"erro": erro}, context_instance=RequestContext(request))

        return response

    response = render_to_response(
        "acidentes_sexo.html",
        {
            "homens_geral": men_general,
            "mulheres_geral": women_general,
            "homens_ano": men_year,
            "mulheres_ano": women_year,
        },
        context_instance=RequestContext(request),
    )

    return response
 def test_estatisticas_media_sexo(self):
     self.assertIsNotNone(estatisticas_util.media_sexo(None, None))