From 24da605c7b69b0a20e8d67416f762fc3c0d95cb9 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 14 May 2015 19:56:43 +0000 Subject: [PATCH] Bug 14204: Fix t/db_dependent/Labels/t_Batch.t failing test from Bug 12991 This patch updaes the batch_id variable after items are added to test batch To test: 1. prove t/db_dependent/Labels/t_Batch.t and see two tests fail 2. apply patch 3. prove again, tests pass! Signed-off-by: Mark Tompsett NOTE: The $batch->add_item() call to C4::Creators::Batch::add_item triggers the change of the batch_id so this line is necessary! Signed-off-by: Tomas Cohen Arazi Signed-off-by: Mason James --- t/db_dependent/Labels/t_Batch.t | 1 + 1 file changed, 1 insertion(+) diff --git a/t/db_dependent/Labels/t_Batch.t b/t/db_dependent/Labels/t_Batch.t index c9996023c1..3e0468eba9 100644 --- a/t/db_dependent/Labels/t_Batch.t +++ b/t/db_dependent/Labels/t_Batch.t @@ -94,6 +94,7 @@ my $itemnumbers = $iteminfo[0]; for my $itemnumber ( @$itemnumbers ) { ok($batch->add_item($itemnumber) eq 0 ) || diag "Batch->add_item() FAILED."; } +$batch_id=$batch->get_attr('batch_id'); diag "Testing Batch->retrieve() method."; ok(my $saved_batch = C4::Labels::Batch->retrieve(batch_id => $batch_id)) || diag "Batch->retrieve() FAILED."; -- 2.39.5