示例#1
0
def test_get_receptionists(mock_connect):
    """Get all receptionist users from database"""
    with allure.step('Get all receptionists'):
        with app.app_context():
            db = AndrewDB()
            expected = {1: 'user1'}
            mock_connect().cursor.return_value.fetchone.return_value = expected
            result = db.get_all_receptionists(1)
        assert result == expected
示例#2
0
def manageBooking():
    logger.info("Got a Manage booking page request: %s" % request)
    db = AndrewDB()
    if 'recep' not in session:
        session['recep'] = db.get_all_receptionists(current_user.user_id)
    if 'hotel' not in session:
        session['hotel'] = db.get_vw_hotel_by_id(session['recep']['hotel_id'])
    recep = session['recep']
    hotel = session['hotel']
    bookings = db.get_booked_rooms_by_hotel_id(recep['hotel_id'])
    logger.info("Rendering the Booked rooms page")
    return render_template('booked_rooms.html', bookings=bookings, hotel=hotel)