def _test_vouchers(self, vouchers):
        ''' Tests each of the vouchers against self._test_voucher() and raises
        the collective ValidationError.
        Future work will refactor _test_voucher in terms of this, and save some
        queries. '''
        errors = []
        for voucher in vouchers:
            try:
                self._test_voucher(voucher)
            except ValidationError as ve:
                errors.append(ve)

        if errors:
            raise(ValidationError(errors))
def _test_vouchers ( self , vouchers ) : errors = [ ] for voucher in vouchers : try : self . _test_voucher ( voucher ) except ValidationError as ve : errors . append ( ve ) if errors : raise ( ValidationError ( errors ) )
Tests each of the vouchers against self._test_voucher() and raises
        the collective ValidationError.
        Future work will refactor _test_voucher in terms of this, and save some
        queries.