Beispiel #1
0
    def test_shift_prereqs_no_shirt(self, staff_get_food_true):
        assert not Attendee(
            placeholder=False,
            shirt=c.NO_SHIRT,
            food_restrictions=FoodRestrictions()).shift_prereqs_complete

        assert not Attendee(
            placeholder=False,
            shirt=c.SIZE_UNKNOWN,
            food_restrictions=FoodRestrictions()).shift_prereqs_complete
def import_attendees(session):
    for a in dump['attendees']:
        a['group'] = groups.get(a.pop('group_id', None))
        secret_id = a.pop('secret_id')
        a['assigned_depts_ids'] = all_dept_ids_from_existing_locations(a.pop('assigned_depts', ''))
        a['requested_depts_ids'] = all_dept_ids_from_existing_locations(a.pop('requested_depts', ''))
        del a['amount_paid']
        del a['amount_refunded']
        if a['badge_type'] == 67489953:  # Supporter is no longer a badge type
            skipped_attendees.append(secret_id)
            continue
        attendees[secret_id] = Attendee(**a)
        session.add(attendees[secret_id])

    for f in dump['food']:
        attendee_id = f.pop('attendee_id')
        if attendee_id in skipped_attendees:
            continue
        f['attendee'] = attendees[attendee_id]
        f.setdefault('sandwich_pref', str(c.PEANUT_BUTTER))  # sandwich_pref didn't exist when the dump was taken
        session.add(FoodRestrictions(**f))

    for h in dump['hotel']:
        attendee_id = h.pop('attendee_id')
        if attendee_id in skipped_attendees:
            continue
        h['attendee'] = attendees[attendee_id]
        session.add(HotelRequests(**h))
def import_attendees(session):
    for a in dump['attendees']:
        a['group'] = groups.get(a.pop('group_id', None))
        secret_id = a.pop('secret_id')
        a['assigned_depts_ids'] = all_dept_ids_from_existing_locations(a.pop('assigned_depts', ''))
        a['requested_depts_ids'] = all_dept_ids_from_existing_locations(a.pop('requested_depts', ''))
        attendees[secret_id] = Attendee(**a)
        session.add(attendees[secret_id])

    for f in dump['food']:
        f['attendee'] = attendees[f.pop('attendee_id')]
        f.setdefault('sandwich_pref', str(c.PEANUT_BUTTER))  # sandwich_pref didn't exist when the dump was taken
        session.add(FoodRestrictions(**f))

    for h in dump['hotel']:
        h['attendee'] = attendees[h.pop('attendee_id')]
        session.add(HotelRequests(**h))
Beispiel #4
0
 def test_shift_prereqs_placeholder(self, staff_get_food_true):
     assert not Attendee(placeholder=True, shirt=1, food_restrictions=FoodRestrictions()).shift_prereqs_complete
Beispiel #5
0
 def test_food_restrictions_filled_out(self, staff_get_food_true):
     assert Attendee(food_restrictions=FoodRestrictions()).food_restrictions_filled_out