コード例 #1
0
ファイル: menu_web.py プロジェクト: muyumiya1201/loveat2
def menu():
    # ----deal time----#
    WEEK = {
        "mon": "星期一",
        "tue": "星期二",
        "wed": "星期三",
        "thu": "星期四",
        "fri": "星期五",
        "sat": "星期六",
        "sun": "星期日",
    }
    raw_time = business_time.get()
    bussiness_time = {}
    for i in raw_time:
        bussiness_time[WEEK[i]] = (
            raw_time[i]["start"] + " - " + raw_time[i]["end"]
        )
    # ----return----#
    return render_template(
        "menu.html",
        menu=Menu.get_all(),
        bussiness_data=bussiness_time,
        auth=current_user.role,
        name=current_user.name,
        id=current_user.id,
    )
コード例 #2
0
 def test_get(self, mockdb):
     result = business_time.get()
     assert result == {
         "mon": {
             "start": "06:00",
             "end": "13:00"
         },
         "tue": {
             "start": "06:00",
             "end": "13:00"
         },
         "wed": {
             "start": "06:00",
             "end": "13:00"
         },
         "thu": {
             "start": "06:00",
             "end": "13:00"
         },
         "fri": {
             "start": "06:00",
             "end": "13:00"
         },
         "sat": {
             "start": "06:00",
             "end": "13:00"
         },
         "sun": {
             "start": "06:00",
             "end": "13:00"
         },
     }