async def home(request: Request, db: Session = Depends(get_db)): quote = daily_quotes.get_quote_of_day(db) return templates.TemplateResponse( "index.html", { "request": request, "quote": quote, }, )
def test_get_quote_of_day_get_first_quote(session, quote1, quote2): assert daily_quotes.get_quote_of_day( session, DATE).text == quote1.text
def test_get_quote_of_day_get_second_quote(session, quote1, quote2): assert daily_quotes.get_quote_of_day( session, DATE2).text == quote2.text
def test_get_quote_of_day_no_quotes(session): assert daily_quotes.get_quote_of_day(session, DATE) is None