Bugzilla – Attachment 155932 Details for
Bug 34848
SIP/Message.t is failing if the DB has been upgraded
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34848: Fix SIP/Message.t if DB has been upgraded
Bug-34848-Fix-SIPMessaget-if-DB-has-been-upgraded.patch (text/plain), 3.26 KB, created by
Jonathan Druart
on 2023-09-20 14:02:03 UTC
(
hide
)
Description:
Bug 34848: Fix SIP/Message.t if DB has been upgraded
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-09-20 14:02:03 UTC
Size:
3.26 KB
patch
obsolete
>From b3bb9c326f2c5716ec7565b81dc43ec016bd8e21 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 20 Sep 2023 16:00:08 +0200 >Subject: [PATCH] Bug 34848: Fix SIP/Message.t if DB has been upgraded > >There were a lot of failures (in the context of bug 34841) > >t/db_dependent/SIP/Message.t .. 2/16 > # Failed test 'Found AH field as timestamp in response' > # at t/db_dependent/SIP/Message.t line 820. > > # Failed test 'Found AH field as SQL date in response' > # at t/db_dependent/SIP/Message.t line 825. > # Looks like you failed 2 tests of 8. >t/db_dependent/SIP/Message.t .. 3/16 > > # Failed test 'Desensitize flag was set for patron category not in inhouse_patron_categories' > # at t/db_dependent/SIP/Message.t line 1133. > # got: 'N' > # expected: 'Y' > > # Failed test 'Desensitize flag was set for empty inhouse_patron_categories' > # at t/db_dependent/SIP/Message.t line 1139. > # got: 'N' > # expected: 'Y' > >Because renewalsallowed is 0 for upgraded DB, when it's 5 for new >install. > >We need to set the value. > >This patch also adds some missing transaction >--- > t/db_dependent/SIP/Message.t | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > >diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t >index e4f0e38385e..0ac278c4b30 100755 >--- a/t/db_dependent/SIP/Message.t >+++ b/t/db_dependent/SIP/Message.t >@@ -35,6 +35,7 @@ use C4::Circulation qw( AddIssue AddReturn ); > use Koha::Database; > use Koha::AuthUtils qw(hash_password); > use Koha::DateUtils qw( dt_from_string output_pref ); >+use Koha::CirculationRules; > use Koha::Items; > use Koha::Checkouts; > use Koha::Old::Checkouts; >@@ -380,6 +381,9 @@ subtest "Test build_custom_field_string" => sub { > }; > > subtest "Test cr_item_field" => sub { >+ my $schema = Koha::Database->new->schema; >+ $schema->storage->txn_begin; >+ > plan tests => 8; > > my $builder = t::lib::TestBuilder->new(); >@@ -483,6 +487,8 @@ subtest "Test cr_item_field" => sub { > $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); > $msg->handle_item_information( $server ); > ok( $response =~ m/AH1999-01-01 12:59/, "Found correct CR field in response"); >+ >+ $schema->storage->txn_rollback; > }; > > subtest 'Patron info summary > 5 should not crash server' => sub { >@@ -575,6 +581,7 @@ subtest 'SC status tests' => sub { > > dies_ok{ $msg->handle_sc_status( $server ) } ,"Dies if sip user cannot be found"; > >+ $schema->storage->txn_rollback; > }; > > # Here is room for some more subtests >@@ -761,6 +768,8 @@ sub test_checkout_v2 { > my ( $response, $findpatron ); > my $mocks = create_mocks( \$response, \$findpatron, \$branchcode ); > >+ >+ > # create some data > my $patron1 = $builder->build({ > source => 'Borrower', >@@ -1262,6 +1271,16 @@ sub create_mocks { > $mockILS->mock( 'institution_id', sub { $$branchcode; } ); > $mockILS->mock( 'find_patron', sub { $$findpatron; } ); > >+ Koha::CirculationRules->set_rule( >+ { >+ categorycode => undef, >+ itemtype => undef, >+ branchcode => undef, >+ rule_name => 'renewalsallowed', >+ rule_value => '5', >+ } >+ ); >+ > return { ils => $mockILS, message => $mockMsg }; > } > >-- >2.25.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 34848
:
155932
|
155963
|
156037
|
156038