Bugzilla – Attachment 103434 Details for
Bug 13345
Choose the format for the attached file when sending a basket/list by email
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13345: Fix BuildBiblioDataForExport tests
Bug-13345-Fix-BuildBiblioDataForExport-tests.patch (text/plain), 2.93 KB, created by
Bernardo Gonzalez Kriegel
on 2020-04-22 00:52:52 UTC
(
hide
)
Description:
Bug 13345: Fix BuildBiblioDataForExport tests
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2020-04-22 00:52:52 UTC
Size:
2.93 KB
patch
obsolete
>From 9a1d5db4a2a280fd9a3de79262a1695f273b0723 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 27 Mar 2020 12:48:38 +0000 >Subject: [PATCH] Bug 13345: Fix BuildBiblioDataForExport tests > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >--- > .../Biblio/BuildBiblioDataForExport.t | 24 ++++++++----------- > 1 file changed, 10 insertions(+), 14 deletions(-) > >diff --git a/t/db_dependent/Biblio/BuildBiblioDataForExport.t b/t/db_dependent/Biblio/BuildBiblioDataForExport.t >index e78f8ae328..c4c77b18bf 100644 >--- a/t/db_dependent/Biblio/BuildBiblioDataForExport.t >+++ b/t/db_dependent/Biblio/BuildBiblioDataForExport.t >@@ -10,18 +10,16 @@ use C4::Context; > use C4::Items; > use C4::Record; > use Koha::DateUtils; >+use Koha::Item; > >-my $dbh = C4::Context->dbh; >-$dbh->{AutoCommit} = 0; >-$dbh->{RaiseError} = 1; >+my $schema = Koha::Database->new()->schema(); >+$schema->storage->txn_begin(); > >-my $module_biblio = Test::MockModule->new('C4::Biblio'); >- >-#my $title = q|The art of computer programming μΣä¼Ã©|; > my $title = q|The art of computer programming|; > my $record = new_record(); > my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, q|| ); >-AddItem({ homebranch => 'CPL', holdingbranch => 'CPL', itype => 'CANNOT', barcode => 'my new barcode' }, $biblionumber); >+Koha::Item->new({ homebranch => 'CPL', holdingbranch => 'CPL', itype => 'CANNOT', barcode => 'my new barcode', biblionumber => $biblionumber })->store; >+ > > subtest 'csv' => sub { > plan tests => 1; >@@ -65,7 +63,7 @@ subtest 'ris' => sub { > biblionumbers => [ $biblionumber ], > format => 'ris', > }); >- is( $ris_data->{records_file}, qq|TY - BOOK\r\nAU - Knuth, Donald Ervin\r\nTI - $title\r\nKW - Computer programming\r\nKW - Computer algorithms\r\nER - \r\n|,); >+ is( $ris_data->{records_file}, qq|TY - BOOK\r\nAU - Knuth,Donald Ervin\r\nTI - $title\r\nKW - Computer programming\r\nKW - Computer algorithms\r\nER - \r\n|,); > }; > > subtest 'bibtex' => sub { >@@ -74,15 +72,13 @@ subtest 'bibtex' => sub { > biblionumbers => [ $biblionumber ], > format => 'bibtex', > }); >- is( $bibtex_data->{records_file}, qq|\@book{$biblionumber, >- author = {Knuth, Donald Ervin}, >- title = {The art of computer programming} >-} >-|); >+ my $expected = qq|\@book{$biblionumber,\n\tauthor = {Knuth, Donald Ervin},\n\ttitle = {The art of computer programming}\n}\n|; >+ is( $bibtex_data->{records_file}, $expected); > }; > > sub insert_csv_profile { > my ( $params ) = @_; >+ my $dbh = C4::Context->dbh; > $dbh->do(q| > INSERT INTO export_format(profile, description, content, csv_separator, field_separator, subfield_separator, encoding, type) VALUES (?, ?, ?, ?, ?, ?, ?, ?) > |, {}, ("TEST_PROFILE4", "my desc", $params->{csv_content}, '|', ';', ',', 'utf8', 'marc') >@@ -136,4 +132,4 @@ sub new_record { > return $record; > } > >-done_testing; >+$schema->storage->txn_rollback(); >-- >2.17.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 13345
:
34013
|
34392
|
35509
|
36270
|
38032
|
47297
|
56499
|
61210
|
100886
|
101998
|
101999
|
103433
|
103434
|
103435
|
119078