From bfe90192bda2f94b23cd503cbd823c1cfcafc4b1 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! --- 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 95f7b40..1fedec8 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.1.4