Setup Tests

This commit is contained in:
2024-05-21 13:29:43 +02:00
parent 2153bb07b9
commit bf6d3b737a
8 changed files with 99 additions and 42 deletions

View File

@ -9,7 +9,7 @@ import icalendar
from icalendar import Calendar, Event
import json
from init import scheduler, app, Rapla, db
from init import scheduler, flask_app, Rapla, db
async def fetchPlan(session, url):
@ -98,7 +98,7 @@ def getIcal(kurs: str):
rapla = Rapla.query.filter(Rapla.name == kurs).first()
try:
return rapla.file
except KeyError:
except AttributeError or KeyError:
return None
@ -136,7 +136,7 @@ async def refreshRapla():
@scheduler.task('cron', id="raplaschedule", hour='*', day_of_week='*', minute='*/3', week='*', second='40')
def raplaSchedule():
with app.app_context():
with flask_app.app_context():
asyncio.run(refreshRapla())