Bug 24546 - Club/Hold.t has a wrong call to build_sample_item
Summary: Club/Hold.t has a wrong call to build_sample_item
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 19618
Blocks: 24363
  Show dependency treegraph
 
Reported: 2020-01-30 14:37 UTC by Jonathan Druart
Modified: 2020-11-30 21:45 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.03
Circulation function:


Attachments
Bug 24546: Fix intentions of build_sample_item in Club/Hold.t (2.00 KB, patch)
2020-01-30 14:39 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24546: Fix intentions of build_sample_item in Club/Hold.t (2.04 KB, patch)
2020-01-31 08:10 UTC, David Nind
Details | Diff | Splinter Review
Bug 24546: Fix intentions of build_sample_item in Club/Hold.t (2.10 KB, patch)
2020-01-31 12:35 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2020-01-30 14:37:34 UTC
In t/db_dependent/Koha/Club/Hold.t:
my $item1 = $builder->build_sample_item({ branchcode => $library->branchcode });
my $item2 = $builder->build_sample_item({ branchcode => $library->branchcode });

build_sample_item takes either "library" or the item's attributes.
branchcode is not part of the item's table, so what those 2 lines are trying to acchieve is wrong.
Comment 1 Jonathan Druart 2020-01-30 14:38:19 UTC
Coming from
  commit 474eca3dbcabe40eead066c3221d4984b0b890b4
  Bug 19618: Add tests
Comment 2 Jonathan Druart 2020-01-30 14:39:55 UTC
Created attachment 98160 [details] [review]
Bug 24546: Fix intentions of build_sample_item in Club/Hold.t

In t/db_dependent/Koha/Club/Hold.t:
my $item1 = $builder->build_sample_item({ branchcode => $library->branchcode });
my $item2 = $builder->build_sample_item({ branchcode => $library->branchcode });

build_sample_item takes either "library" or the item's attributes.
branchcode is not part of the item's table, so what those 2 lines are trying to acchieve is wrong.

Test plan:
 % prove t/db_dependent/Koha/Club/Hold.t
must return green before and after this patch

Note that this patch also remove an uneeded debugging statement.

This has been caught by bug 24363.
Comment 3 David Nind 2020-01-31 08:10:58 UTC
Created attachment 98216 [details] [review]
Bug 24546: Fix intentions of build_sample_item in Club/Hold.t

In t/db_dependent/Koha/Club/Hold.t:
my $item1 = $builder->build_sample_item({ branchcode => $library->branchcode });
my $item2 = $builder->build_sample_item({ branchcode => $library->branchcode });

build_sample_item takes either "library" or the item's attributes.
branchcode is not part of the item's table, so what those 2 lines are trying to acchieve is wrong.

Test plan:
 % prove t/db_dependent/Koha/Club/Hold.t
must return green before and after this patch

Note that this patch also remove an uneeded debugging statement.

This has been caught by bug 24363.

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Tomás Cohen Arazi (tcohen) 2020-01-31 12:35:25 UTC
Created attachment 98227 [details] [review]
Bug 24546: Fix intentions of build_sample_item in Club/Hold.t

In t/db_dependent/Koha/Club/Hold.t:
my $item1 = $builder->build_sample_item({ branchcode => $library->branchcode });
my $item2 = $builder->build_sample_item({ branchcode => $library->branchcode });

build_sample_item takes either "library" or the item's attributes.
branchcode is not part of the item's table, so what those 2 lines are trying to acchieve is wrong.

Test plan:
 % prove t/db_dependent/Koha/Club/Hold.t
must return green before and after this patch

Note that this patch also remove an uneeded debugging statement.

This has been caught by bug 24363.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Martin Renvoize (ashimema) 2020-01-31 13:56:21 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 6 Joy Nelson 2020-02-10 23:53:17 UTC
Pushed to 19.11.x branch for 19.11.03
Comment 7 Lucas Gass (lukeg) 2020-02-14 21:02:14 UTC
missing dependencies for 19.05.x, no backport