-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix-17-testversion-online
- Loading branch information
Showing
15 changed files
with
120 additions
and
387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
|
||
def send_reminder(agenda): | ||
failed = 0 | ||
user = agenda.created_by | ||
user_info = db(db.auth_user.id == user).select(db.auth_user.first_name, db.auth_user.email).first() | ||
context = dict(user_info=user_info, agenda=agenda) | ||
message = response.render('message.html', context) | ||
while failed < myconf.take('email_var.error'): | ||
if mail.send(to=user_info.email, | ||
subject='Recordatorio de Openlex', | ||
message=message): | ||
return db.commit() | ||
else: | ||
failed = failed + 1 | ||
|
||
|
||
def daily_check_email(): | ||
today = request.now | ||
agenda = db(db.agenda.vencimiento != None).select(db.agenda.vencimiento, db.agenda.recordatorio, db.agenda.titulo, db.agenda.created_by) | ||
for agenda_single in agenda: | ||
if agenda_single.recordatorio != 0 : | ||
reminder_id = agenda_single.recordatorio | ||
vencimientos = (agenda_single.vencimiento - today).days | ||
if (vencimientos == int(reminder_id)): | ||
send_reminder(agenda_single) | ||
|
||
|
||
if __name__ == "__main__": | ||
daily_check_email() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
#crontab | ||
#crontab | ||
0 0 * * * root *applications/OpenLex_pruebs/cron/check_email.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,6 @@ | ||
# Este es un testing de la funcionalidad de carga y eliminación de expedientes. | ||
|
||
def test_expedientes(page): | ||
# Go to main page | ||
page.goto("http://127.0.0.1:8020/OpenLex/") | ||
|
||
# Click text=Log In | ||
page.click("text=Log In") | ||
|
||
# Click :nth-match(i, 3) | ||
page.click(":nth-match(i, 3)") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/default/user/login?_next=/OpenLex/default/index" | ||
|
||
# Click input[name="email"] | ||
page.click("input[name=\"email\"]") | ||
|
||
# Fill input[name="email"] | ||
page.fill("input[name=\"email\"]", "[email protected]") | ||
page.press("input[name=\"email\"]", "Tab") | ||
|
||
# Click input[name="password"] | ||
page.click("input[name=\"password\"]") | ||
|
||
# Fill input[name="password"] | ||
page.fill("input[name=\"password\"]", "openlex1234") | ||
page.press("input[name=\"password\"]", "Tab") | ||
|
||
# Click input:has-text("Log In") | ||
page.click("input:has-text(\"Log In\")") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/dashboard/view#" | ||
|
||
def test_expedientes(page, login): | ||
# Click text=Expedientes | ||
page.click("text=Expedientes") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/expedientes/index" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
def test_agenda_issue56_without_reminder(page, login): | ||
# Click text=Agenda | ||
page.click("text=Agenda") | ||
assert page.url.endswith("/agenda/agenda") | ||
# Click a:has-text("Agregar") | ||
page.click("a:has-text(\"Agregar\")") | ||
assert page.url.endswith("/agenda/agenda/new/agenda") | ||
# Click input[name="_autocomplete_expediente_numero_aux"] | ||
page.click("input[name=\"_autocomplete_expediente_numero_aux\"]") | ||
# Fill input[name="_autocomplete_expediente_numero_aux"] | ||
page.fill("input[name=\"_autocomplete_expediente_numero_aux\"]", "11") | ||
# Click input[name="titulo"] | ||
page.click("input[name=\"titulo\"]") | ||
# Fill input[name="titulo"] | ||
page.fill("input[name=\"titulo\"]", "tarea erronea sin recordatorio") | ||
# Click text=Enviar | ||
page.click("text=Enviar") | ||
assert page.url.endswith("/agenda/agenda/new/agenda#") | ||
# Error Message | ||
# Click text=Establezca la frecuencia correcta | ||
page.click("text=Establezca la frecuencia correcta") | ||
# Select S | ||
page.select_option("select[name=\"recordatorio\"]", "0") | ||
# Click text=Enviar | ||
page.click("text=Enviar") | ||
assert page.url.endswith("/agenda/agenda/new/agenda#") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,12 @@ | ||
# Acá realizaremos un testing de la funcionalidad de carga y eliminación de contactos. | ||
|
||
def test_contactos(page): | ||
# Go to main page | ||
page.goto("http://127.0.0.1:8020/OpenLex/") | ||
|
||
# Click text=Log In | ||
page.click("text=Log In") | ||
|
||
# Click :nth-match(:text("Log In"), 2) | ||
page.click(":nth-match(:text(\"Log In\"), 2)") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/default/user/login?_next=/OpenLex/default/index" | ||
|
||
# Click input[name="email"] | ||
page.click("input[name=\"email\"]") | ||
|
||
# Fill input[name="email"] | ||
page.fill("input[name=\"email\"]", "[email protected]") | ||
page.press("input[name=\"email\"]", "Tab") | ||
|
||
# Click input[name="password"] | ||
page.click("input[name=\"password\"]") | ||
|
||
# Fill input[name="password"] | ||
page.fill("input[name=\"password\"]", "openlex1234") | ||
page.press("input[name=\"password\"]", "Tab") | ||
|
||
# Click input:has-text("Log In") | ||
page.click("input:has-text(\"Log In\")") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/dashboard/view#" | ||
|
||
def test_contactos(page, login): | ||
# Click text=Contactos | ||
page.click("text=Contactos") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/contactos/index" | ||
assert page.url.endswith("/contactos/index") | ||
|
||
# Click a:has-text("Agregar") | ||
page.click("a:has-text(\"Agregar\")") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/contactos/index/new/persona?_signature=08fbad2cf0e79833b0ba8d2ed92faeeee5c705dd" | ||
|
||
# Select F | ||
page.select_option("select[name=\"sexo\"]", "F") | ||
|
@@ -99,84 +70,10 @@ def test_contactos(page): | |
page.fill("input[name=\"matricula\"]", "666777") | ||
page.press("input[name=\"matricula\"]", "Tab") | ||
|
||
# Click input[name="domiciliolegal"] | ||
page.click("input[name=\"domiciliolegal\"]") | ||
|
||
# Fill input[name="domiciliolegal"] | ||
page.fill("input[name=\"domiciliolegal\"]", "Boulevard del Tux, Ciudad GNU") | ||
page.press("input[name=\"domiciliolegal\"]", "Tab") | ||
|
||
# Click input[name="domiciliolegal"] | ||
page.click("input[name=\"domiciliolegal\"]") | ||
|
||
# Click input[name="domiciliolegal"] | ||
page.click("input[name=\"domiciliolegal\"]") | ||
|
||
# Press ArrowLeft | ||
page.press("input[name=\"domiciliolegal\"]", "ArrowLeft") | ||
|
||
# Press ArrowLeft | ||
page.press("input[name=\"domiciliolegal\"]", "ArrowLeft") | ||
|
||
# Press ArrowLeft | ||
page.press("input[name=\"domiciliolegal\"]", "ArrowLeft") | ||
|
||
# Press ArrowLeft | ||
page.press("input[name=\"domiciliolegal\"]", "ArrowLeft") | ||
|
||
# Press ArrowLeft | ||
page.press("input[name=\"domiciliolegal\"]", "ArrowLeft") | ||
|
||
# Press ArrowLeft | ||
page.press("input[name=\"domiciliolegal\"]", "ArrowLeft") | ||
|
||
# Press ArrowLeft | ||
page.press("input[name=\"domiciliolegal\"]", "ArrowLeft") | ||
|
||
# Press ArrowLeft | ||
page.press("input[name=\"domiciliolegal\"]", "ArrowLeft") | ||
|
||
# Press ArrowLeft | ||
page.press("input[name=\"domiciliolegal\"]", "ArrowLeft") | ||
|
||
# Press ArrowRight | ||
page.press("input[name=\"domiciliolegal\"]", "ArrowRight") | ||
|
||
# Press ArrowRight | ||
page.press("input[name=\"domiciliolegal\"]", "ArrowRight") | ||
|
||
# Fill input[name="domiciliolegal"] | ||
page.fill("input[name=\"domiciliolegal\"]", "Boulevard del Tux 1992, Ciudad GNU") | ||
page.press("input[name=\"domiciliolegal\"]", "Tab") | ||
|
||
# Click text=Enviar | ||
page.click("text=Enviar") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/contactos/index?_signature=757a993c643dc478b57b21486e68f722168946fc#" | ||
|
||
# Click text=Apellido o Razón Social | ||
page.click("text=Apellido o Razón Social") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/contactos/index?order=persona.apellido&_signature=757a993c643dc478b57b21486e68f722168946fc" | ||
|
||
# Click text=Nombre | ||
page.click("text=Nombre") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/contactos/index?order=persona.nombre&_signature=757a993c643dc478b57b21486e68f722168946fc" | ||
|
||
# Click text=Nombre▲ | ||
page.click("text=Nombre▲") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/contactos/index?order=~persona.nombre&_signature=757a993c643dc478b57b21486e68f722168946fc" | ||
|
||
# Click text=Domicilio | ||
page.click("text=Domicilio") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/contactos/index?order=persona.domicilio&_signature=757a993c643dc478b57b21486e68f722168946fc" | ||
|
||
# Click text=E-Mail | ||
page.click("text=E-Mail") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/contactos/index?order=persona.email&_signature=757a993c643dc478b57b21486e68f722168946fc" | ||
|
||
# Click text=Teléfono | ||
page.click("text=Teléfono") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/contactos/index?order=persona.telefono&_signature=757a993c643dc478b57b21486e68f722168946fc" | ||
|
||
|
||
# Click text=Vista | ||
page.click("text=Vista") | ||
# assert page.url == "http://127.0.0.1:8020/OpenLex/contactos/index/view/persona/1?order=persona.telefono&_signature=b9ce84649e3cdacb7bd38da86223c5840c41449d" | ||
|
Oops, something went wrong.