Bugzilla – Attachment 125817 Details for
Bug 28445
Use the task queue for the batch delete and update items tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28445: Improve robustness of tests
Bug-28445-Improve-robustness-of-tests.patch (text/plain), 2.90 KB, created by
Jonathan Druart
on 2021-10-06 13:47:02 UTC
(
hide
)
Description:
Bug 28445: Improve robustness of tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-10-06 13:47:02 UTC
Size:
2.90 KB
patch
obsolete
>From 0aba2d4322f92d9a48800d6523f80978831d1f87 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 Oct 2021 15:45:17 +0200 >Subject: [PATCH] Bug 28445: Improve robustness of tests > >* Could fail if not using the original sample data: build the AV we need >instead of relying on what is in the DB >* Libraries are ordered by name by default but if others have been added >the test may fail >--- > t/db_dependent/Koha/Item.t | 10 +++++----- > t/db_dependent/Koha/UI/Form/Builder/Item.t | 2 +- > 2 files changed, 6 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 32cad939749..b09e9e7ea60 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -1115,7 +1115,7 @@ subtest 'columns_to_str' => sub { > > my $biblio = $builder->build_sample_biblio({ frameworkcode => '' }); > my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); >- my $itemlost = Koha::AuthorisedValues->search({ category => 'LOST' })->next->authorised_value; >+ my $lost_av = $builder->build_object({ class => 'Koha::AuthorisedValues', value => { category => 'LOST', authorised_value => '42' }}); > my $dateaccessioned = '2020-12-15'; > my $library = Koha::Libraries->search->next; > my $branchcode = $library->branchcode; >@@ -1138,7 +1138,7 @@ subtest 'columns_to_str' => sub { > > $item->update( > { >- itemlost => $itemlost, >+ itemlost => $lost_av->authorised_value, > dateaccessioned => $dateaccessioned, > more_subfields_xml => $some_marc_xml, > } >@@ -1147,9 +1147,9 @@ subtest 'columns_to_str' => sub { > $item = $item->get_from_storage; > > my $s = $item->columns_to_str; >- is( $s->{itemlost}, 'Lost' ); >- is( $s->{dateaccessioned}, '2020-12-15'); >- is( $s->{é}, 'value é'); >+ is( $s->{itemlost}, $lost_av->lib, 'Attributes linked with AV replaced with description' ); >+ is( $s->{dateaccessioned}, '2020-12-15', 'Date attributes iso formatted'); >+ is( $s->{é}, 'value é', 'subfield ok with more than a-Z'); > is( $s->{è}, $library->branchname ); > > $cache->clear_from_cache("MarcStructure-0-"); >diff --git a/t/db_dependent/Koha/UI/Form/Builder/Item.t b/t/db_dependent/Koha/UI/Form/Builder/Item.t >index 413d837c8c1..386241c637f 100755 >--- a/t/db_dependent/Koha/UI/Form/Builder/Item.t >+++ b/t/db_dependent/Koha/UI/Form/Builder/Item.t >@@ -96,7 +96,7 @@ subtest 'authorised values' => sub { > subtest 'branches' => sub { > plan tests => 2; > my ( $subfield ) = grep { $_->{kohafield} eq 'items.homebranch' } @$subfields; >- my $libraries = Koha::Libraries->search; >+ my $libraries = Koha::Libraries->search({}, { order_by => 'branchname' }); > is_deeply( > $subfield->{marc_value}->{values}, > [ $libraries->get_column('branchcode') ] >-- >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 28445
:
121372
|
123221
|
123222
|
123223
|
123224
|
123225
|
123226
|
123227
|
123228
|
123229
|
123239
|
123240
|
125801
|
125802
|
125803
|
125804
|
125805
|
125808
|
125810
|
125811
|
125812
|
125817
|
125865
|
126046
|
126047
|
126136
|
126137
|
126138
|
126139
|
126140
|
126141
|
126142
|
126217
|
126218
|
126219
|
126223
|
126328
|
126329
|
126330
|
126331
|
126332
|
126333
|
126334
|
126335
|
126336
|
126337
|
126338
|
126339
|
126352
|
126353
|
126354
|
126355
|
126356
|
126357
|
126358
|
126359
|
126360
|
126361
|
126362
|
126363
|
126364
|
126365
|
126366
|
126367
|
126374
|
126375
|
126376
|
126377
|
126378
|
126379
|
126380
|
126381
|
126382
|
126383
|
126384
|
126385
|
126386
|
126387
|
126388
|
126389
|
127033
|
127037
|
127038
|
127039
|
128007
|
128008
|
128009