Bug 38744: Wrap tests in Biblio.t inside a transaction

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Tomas Cohen Arazi 2024-12-18 11:33:56 -03:00 committed by Katrin Fischer
parent a98760a994
commit 2f3ab812df
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 22 additions and 3 deletions

View File

@ -1697,9 +1697,12 @@ subtest 'item_groups() tests' => sub {
$schema->storage->txn_rollback;
};
subtest 'normalized_isbn' => sub {
subtest 'normalized_isbn() tests' => sub {
plan tests => 1;
$schema->storage->txn_begin;
# We will move the tests from GetNormalizedISBN here when it will get replaced
my $biblio = $builder->build_sample_biblio();
$biblio->biblioitem->set( { isbn => '9781250067128 | 125006712X' } )->store;
@ -1707,11 +1710,16 @@ subtest 'normalized_isbn' => sub {
$biblio->normalized_isbn, C4::Koha::GetNormalizedISBN( $biblio->biblioitem->isbn ),
'normalized_isbn is a wrapper around C4::Koha::GetNormalizedISBN'
);
$schema->storage->txn_rollback;
};
subtest 'normalized_upc' => sub {
subtest 'normalized_upc() tests' => sub {
plan tests => 1;
$schema->storage->txn_begin;
# We will move the tests from GetNormalizedUPC here when it will get replaced
# Note that only a single test exist and it's not really meaningful...
my $biblio = $builder->build_sample_biblio();
@ -1719,11 +1727,16 @@ subtest 'normalized_upc' => sub {
$biblio->normalized_upc, C4::Koha::GetNormalizedUPC( $biblio->metadata->record ),
'normalized_upc is a wrapper around C4::Koha::GetNormalizedUPC'
);
$schema->storage->txn_rollback;
};
subtest 'normalized_oclc' => sub {
subtest 'normalized_oclc() tests' => sub {
plan tests => 1;
$schema->storage->txn_begin;
# We will move the tests from GetNormalizedOCLC here when it will get replaced
# Note that only a single test exist and it's not really meaningful...
my $biblio = $builder->build_sample_biblio();
@ -1731,6 +1744,8 @@ subtest 'normalized_oclc' => sub {
$biblio->normalized_oclc, C4::Koha::GetNormalizedOCLCNumber( $biblio->metadata->record ),
'normalized_oclc is a wrapper around C4::Koha::GetNormalizedOCLCNumber'
);
$schema->storage->txn_rollback;
};
subtest 'ratings' => sub {
@ -1743,6 +1758,8 @@ subtest 'opac_summary_html' => sub {
plan tests => 2;
$schema->storage->txn_begin;
my $author = 'my author';
my $title = 'my title';
my $isbn = '9781250067128 | 125006712X';
@ -1761,6 +1778,8 @@ subtest 'opac_summary_html' => sub {
sprintf( 'Replace %s, %s, %s AND %s please', $author, $title, $biblio->normalized_isbn, $biblio->biblionumber ),
'opac_summary_html replaces the different patterns'
);
$schema->storage->txn_rollback;
};
subtest 'can_be_edited() tests' => sub {