def mock_wheel_table(mock_dynamodb): Wheel = mock_dynamodb.Table(WHEEL_TABLE_NAME) add_extended_table_functions(Wheel) yield Wheel wheels = Wheel.scan({})['Items'] with Wheel.batch_writer() as batch: for wheel in wheels: batch.delete_item(Key={'id': wheel['id']})
def mock_participant_table(mock_dynamodb): WheelParticipant = mock_dynamodb.Table(PARTICIPANT_TABLE_NAME) add_extended_table_functions(WheelParticipant) yield WheelParticipant participants = WheelParticipant.scan({})['Items'] with WheelParticipant.batch_writer() as batch: for participant in participants: batch.delete_item(Key={ 'id': participant['id'], 'wheel_id': participant['wheel_id'] })