Example #1
0
    def _get_escuelas(self):
        conn = get_test_connection()
        cur = conn.cursor()
        q_get_escuelas = """SELECT id_ubicacion
                            FROM ubicaciones
                            WHERE clase = 'Establecimiento'"""
        cur.execute(q_get_escuelas)
        escuelas = cur.fetchall()
        cur.close()

        return [e[0] for e in escuelas]
Example #2
0
    def _get_escuelas(self):
        conn = get_test_connection()
        cur = conn.cursor()
        q_get_escuelas = """SELECT id_ubicacion
                            FROM ubicaciones
                            WHERE clase = 'Establecimiento'"""
        cur.execute(q_get_escuelas)
        escuelas = cur.fetchall()
        cur.close()

        return [e[0] for e in escuelas]
Example #3
0
    def _get_nro_mesas(self, id_ubicacion):
        conn = get_test_connection()
        cur = conn.cursor()
        q_get_mesas = """SELECT descripcion
                         FROM ubicaciones
                         WHERE clase = 'Mesa'
                         AND id_ubicacion <@ %s"""
        cur.execute(q_get_mesas, (id_ubicacion, ))
        mesas = cur.fetchall()
        cur.close()

        return [m[0] for m in mesas]
Example #4
0
    def _get_nro_mesas(self, id_ubicacion):
        conn = get_test_connection()
        cur = conn.cursor()
        q_get_mesas = """SELECT descripcion
                         FROM ubicaciones
                         WHERE clase = 'Mesa'
                         AND id_ubicacion <@ %s"""
        cur.execute(q_get_mesas, (id_ubicacion, ))
        mesas = cur.fetchall()
        cur.close()

        return [m[0] for m in mesas]
Example #5
0
    def get_db_for_mesa(self, mesa):
        conn = get_test_connection()
        cur = conn.cursor()
        sql = """SELECT id_cargo,
                        id_candidatura,
                        votos_definitivos
                    FROM planillas_det
                    WHERE id_planilla = %s
        """
        cur.execute(sql, (mesa.id_planilla, ))
        data = cur.fetchall()
        result_dict = {}
        for datum in data:
            key = str(datum[1] if datum[1] != "BLC.BLC.BLC.BLC" else "%s_BLC" %
                      datum[0])
            key = key.rjust(3, "0")
            result_dict[(unicode(datum[0]), unicode(key))] = datum[2]

        return result_dict
Example #6
0
    def test_todos(self):
        conn = get_test_connection()
        cur = conn.cursor()
        sql = """
            UPDATE puntos_de_carga
            SET promiscuo = 'SI',
                certificado = 'MSAWC01'
            WHERE id_punto_de_carga = 'CABA'
        """
        cur.execute(sql)
        conn.commit()
        cur.close()

        pkey = "MSAWC01-Wildcard_1.pkey"
        cert = "MSAWC01-Wildcard_1.cert"
        ca_cert = "CA_Elecciones_CABA_05.07.2015.cert"
        self.crear_recuentos(range(1000, 1010))
        self.arrancar(pkey, cert, ca_cert)
        self._test_multi()
Example #7
0
    def get_db_for_mesa(self, mesa):
        conn = get_test_connection()
        cur = conn.cursor()
        sql = """SELECT id_cargo,
                        id_candidatura,
                        votos_definitivos
                    FROM planillas_det
                    WHERE id_planilla = %s
        """
        cur.execute(sql, (mesa.id_planilla, ))
        data = cur.fetchall()
        result_dict = {}
        for datum in data:
            key = str(datum[1] if datum[1] != "BLC.BLC.BLC.BLC" else "%s_BLC"
                      % datum[0])
            key = key.rjust(3, "0")
            result_dict[(unicode(datum[0]), unicode(key))] = datum[2]

        return result_dict
Example #8
0
    def test_todos(self):
        conn = get_test_connection()
        cur = conn.cursor()
        sql = """
            UPDATE puntos_de_carga
            SET promiscuo = 'SI',
                certificado = 'MSAWC01'
            WHERE id_punto_de_carga = 'CABA'
        """
        cur.execute(sql)
        conn.commit()
        cur.close()

        pkey = "MSAWC01-Wildcard_1.pkey"
        cert = "MSAWC01-Wildcard_1.cert"
        ca_cert = "CA_Elecciones_CABA_05.07.2015.cert"
        self.crear_recuentos(range(1000, 1010))
        self.arrancar(pkey, cert, ca_cert)
        self._test_multi()
Example #9
0
 def get_db_for_mesa(self, mesa):
     try:
         conn = get_test_connection()
         cur = conn.cursor()
         sql = """SELECT id_cargo,
                         id_candidatura,
                         votos_definitivos
                  FROM planillas_det
                  WHERE id_planilla = %s
                        AND id_candidatura NOT IN %s
         """
         cur.execute(sql, (mesa.id_planilla,
                           tuple(get_config("listas_especiales"))))
         data = cur.fetchall()
         result_dict = {}
         for datum in data:
             key = str(datum[1] if datum[1] != -1 else "%s_BLC" % datum[0])
             key = key.rjust(3, "0")
             result_dict[(unicode(datum[0]), unicode(key))] = datum[2]
     except Exception, e:
         logger.debug(e)
Example #10
0
 def get_db_for_mesa(self, mesa):
     try:
         conn = get_test_connection()
         cur = conn.cursor()
         sql = """SELECT id_cargo,
                         id_candidatura,
                         votos_definitivos
                  FROM planillas_det
                  WHERE id_planilla = %s
                        AND id_candidatura NOT IN %s
         """
         cur.execute(
             sql,
             (mesa.id_planilla, tuple(get_config("listas_especiales"))))
         data = cur.fetchall()
         result_dict = {}
         for datum in data:
             key = str(datum[1] if datum[1] != -1 else "%s_BLC" % datum[0])
             key = key.rjust(3, "0")
             result_dict[(unicode(datum[0]), unicode(key))] = datum[2]
     except Exception, e:
         logger.debug(e)