Bugzilla – Attachment 149096 Details for
Bug 29234
Transfers generated by stock rotation alert but do not initiate at checkin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29234: Further clean Z3950 Tests
Bug-29234-Further-clean-Z3950-Tests.patch (text/plain), 4.17 KB, created by
Tomás Cohen Arazi
on 2023-04-03 13:48:47 UTC
(
hide
)
Description:
Bug 29234: Further clean Z3950 Tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2023-04-03 13:48:47 UTC
Size:
4.17 KB
patch
obsolete
>From 14e90ef4bdaeb233636d143df66e9b15823746ae Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 3 Apr 2023 13:15:24 +0000 >Subject: [PATCH] Bug 29234: Further clean Z3950 Tests > >We are deleting all authorised values in Session2.t and assuming they don't exist in Sesson.t > >This patch ensures the tests will work regardless of data in DB > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Z3950Responder/Session.t | 4 ++ > t/db_dependent/Koha/Z3950Responder/Session2.t | 48 +++++++++++-------- > 2 files changed, 33 insertions(+), 19 deletions(-) > >diff --git a/t/db_dependent/Koha/Z3950Responder/Session.t b/t/db_dependent/Koha/Z3950Responder/Session.t >index 48ef6d960f9..f6e7c65f957 100755 >--- a/t/db_dependent/Koha/Z3950Responder/Session.t >+++ b/t/db_dependent/Koha/Z3950Responder/Session.t >@@ -54,6 +54,10 @@ subtest 'add_item_status' => sub { > my $item_field_2 = scalar $item_marc_2->field($itemtag); > ## END SECOND ITEM ## > >+ # We want to test the default values, so we remove custom status alias if present >+ my $available = Koha::AuthorisedValues->find({ category => 'Z3950_STATUS', authorised_value => 'AVAILABLE' }); >+ $available->delete if $available; >+ > # Create the responder > my $args={ PEER_NAME => 'PEER'}; > my $zR = Koha::Z3950Responder->new({add_item_status_subfield => 'k'}); >diff --git a/t/db_dependent/Koha/Z3950Responder/Session2.t b/t/db_dependent/Koha/Z3950Responder/Session2.t >index 1a6ac035ff9..5912d8ff2fb 100755 >--- a/t/db_dependent/Koha/Z3950Responder/Session2.t >+++ b/t/db_dependent/Koha/Z3950Responder/Session2.t >@@ -5,6 +5,7 @@ use Test::More tests => 3; > use t::lib::TestBuilder; > use C4::Items qw( GetMarcItem ); > >+use Koha::AuthorisedValues; > use Koha::Caches; > > BEGIN { >@@ -25,23 +26,32 @@ subtest 'add_item_status' => sub { > plan tests => 2; > > # This time we are sustituting some values >- $builder->schema->resultset( 'AuthorisedValue' )->delete_all(); >- $builder->build({ >- source => 'AuthorisedValue', >- value => { >- category => 'Z3950_STATUS', >- authorised_value => 'AVAILABLE', >- lib => "Free as a bird" >- } >- }); >- $builder->build({ >- source => 'AuthorisedValue', >- value => { >- category => 'Z3950_STATUS', >- authorised_value => 'DAMAGED', >- lib => "Borked completely" >- } >- }); >+ >+ my $available = Koha::AuthorisedValues->find({ category => 'Z3950_STATUS', authorised_value => 'AVAILABLE' }); >+ unless( $available ){ >+ $available = $builder->build_object({ >+ class => 'Koha::AuthorisedValues', >+ value => { >+ category => 'Z3950_STATUS', >+ authorised_value => 'AVAILABLE', >+ lib => "Free as a bird" >+ } >+ }); >+ } >+ my $available_status = $available->lib; >+ >+ my $damaged = Koha::AuthorisedValues->find({ category => 'Z3950_STATUS', authorised_value => 'DAMAGED' }); >+ unless( $damaged ){ >+ $damaged = $builder->build_object({ >+ class => 'Koha::AuthorisedValues', >+ value => { >+ category => 'Z3950_STATUS', >+ authorised_value => 'DAMAGED', >+ lib => "Borked completely" >+ } >+ }); >+ } >+ my $damaged_status = $damaged->lib; > > ## FIRST ITEM HAS ALL THE STATUSES ## > my $item_1 = $builder->build_sample_item( >@@ -81,10 +91,10 @@ subtest 'add_item_status' => sub { > $zR->init_handler($args); > > $args->{HANDLE}->add_item_status($item_field_1); >- is($item_field_1->subfield('k'),"Checked Out, Lost, Not for Loan, Borked completely, Withdrawn, In Transit, On Hold","All statuses added in one field as expected"); >+ is($item_field_1->subfield('k'),"Checked Out, Lost, Not for Loan, $damaged_status, Withdrawn, In Transit, On Hold","All statuses added in one field as expected"); > > $args->{HANDLE}->add_item_status($item_field_2); >- is($item_field_2->subfield('k'),'Free as a bird',"Available status is 'Free as a bird' added as expected"); >+ is($item_field_2->subfield('k'),"$available_status","Available status is '$available_status' added as expected"); > > }; > >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29234
:
126267
|
126269
|
126300
|
126481
|
148751
|
148752
|
149046
|
149093
|
149094
|
149095
| 149096