Bugzilla – Attachment 178922 Details for
Bug 21272
MARC import should warn about mis-matched branch during staged import
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21272: Unit test
Bug-21272-Unit-test.patch (text/plain), 2.43 KB, created by
Hammat wele
on 2025-03-04 15:15:10 UTC
(
hide
)
Description:
Bug 21272: Unit test
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2025-03-04 15:15:10 UTC
Size:
2.43 KB
patch
obsolete
>From fb3cb2610427189b8813027a1fa57b0bfca28804 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Thu, 31 Aug 2023 19:11:04 +0000 >Subject: [PATCH] Bug 21272: Unit test > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/ImportBatch.t | 30 +++++++++++++++++++++++++++++- > 1 file changed, 29 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/ImportBatch.t b/t/db_dependent/ImportBatch.t >index 4016d9686c..e1d47c5ec5 100755 >--- a/t/db_dependent/ImportBatch.t >+++ b/t/db_dependent/ImportBatch.t >@@ -231,7 +231,7 @@ my $import_batch = C4::ImportBatch::GetImportBatch($id_import_batch3); > is( $import_batch, undef, "Batch 3 has been deleted" ); > > subtest "_batchCommitItems" => sub { >- plan tests => 3; >+ plan tests => 6; > > my $exist_item = $builder->build_sample_item; > my $import_item = $builder->build_object( >@@ -269,6 +269,34 @@ subtest "_batchCommitItems" => sub { > $import_item->import_error, 'duplicate item barcode', > 'Error correctly set when import item has duplicate barcode and action always_add' > ); >+ >+ $import_item = $builder->build_object({ class => 'Koha::Import::Record::Items', value => { >+ marcxml => q{<?xml version="1.0" encoding="UTF-8"?> >+<collection >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" >+ xmlns="http://www.loc.gov/MARC21/slim"> >+ >+<record> >+ <leader>00000 a </leader> >+ <datafield tag="952" ind1=" " ind2=" "> >+ <subfield code="a">WBRC</subfield> >+ <subfield code="b">WBRC</subfield> >+ <subfield code="c">GEN</subfield> >+ <subfield code="p">BCDETEST</subfield> >+ <subfield code="y">BK</subfield> >+ </datafield> >+</record> >+</collection> >+ }, >+ }}); >+ >+ ( $num_items_added, $num_items_replaced, $num_items_errored ) = >+ C4::ImportBatch::_batchCommitItems( $import_item->import_record_id, 32, 'always_add',64 ); >+ is( $num_items_errored, 1, "Item with wrong branchcode fails when action always_add" ); >+ $import_item->discard_changes(); >+ is( $import_item->status, 'error', "Import item marked as error when wrong branchcode detected and action always_add"); >+ is( $import_item->import_error, 'Branch code WBRC missing', 'Error correctly set when import item has a wrong branchcode detected and action always_add' ); > }; > > subtest "RecordsFromMarcPlugin" => sub { >-- >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 21272
:
155038
|
155039
|
155043
|
155523
|
155524
|
155525
|
158683
|
163646
|
163648
|
164143
|
164147
|
164148
|
164149
|
178921
|
178922
|
178923
|
178924
|
178925
|
178926
|
178927
|
178928
|
179837
|
179838
|
179839
|
179840
|
179841
|
179842
|
179843
|
179844
|
180383
|
180534
|
180535
|
180536
|
180537
|
180538
|
180539
|
180540
|
180541
|
180542