Bugzilla – Attachment 104352 Details for
Bug 17355
Authorised value categories cannot be deleted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17355: Fix failing tests
Bug-17355-Fix-failing-tests.patch (text/plain), 4.47 KB, created by
Jonathan Druart
on 2020-05-05 08:45:56 UTC
(
hide
)
Description:
Bug 17355: Fix failing tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-05-05 08:45:56 UTC
Size:
4.47 KB
patch
obsolete
>From 4169e2dc8e8d10a46f30649527ff77eb3a0649be Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 5 May 2020 10:44:52 +0200 >Subject: [PATCH] Bug 17355: Fix failing tests > >This patch makes the tests pass without deleting mandatory AV cats >--- > t/db_dependent/AuthorisedValues.t | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > >diff --git a/t/db_dependent/AuthorisedValues.t b/t/db_dependent/AuthorisedValues.t >index 860e97baef..4c297c4818 100644 >--- a/t/db_dependent/AuthorisedValues.t >+++ b/t/db_dependent/AuthorisedValues.t >@@ -17,8 +17,7 @@ my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; > my $builder = t::lib::TestBuilder->new; > >-Koha::AuthorisedValues->delete; >-Koha::AuthorisedValueCategories->delete; >+my @existing_categories = Koha::AuthorisedValues->new->categories; > > # insert > Koha::AuthorisedValueCategory->new({ category_name => 'av_for_testing', is_system => 1 })->store; >@@ -137,14 +136,15 @@ my $limits = $av1->library_limits->as_list; > is( @$limits, 2, 'library_limits functions correctly both as setter and getter' ); > > my @categories = Koha::AuthorisedValues->new->categories; >-is( @categories, 3, 'There should have 2 categories inserted' ); >+is( @categories, @existing_categories+3, 'There should have 3 categories inserted' ); > is( $categories[0], $av4->category, 'The first category should be correct (ordered by category name)' ); > is( $categories[1], $av1->category, 'The second category should be correct (ordered by category name)' ); > > subtest 'search_by_*_field + find_by_koha_field + get_description' => sub { > plan tests => 5; >- my $loc_cat = Koha::AuthorisedValueCategories->find('LOC'); >- $loc_cat->delete if $loc_cat; >+ >+ my $test_cat = Koha::AuthorisedValueCategories->find('TEST'); >+ $test_cat->delete if $test_cat; > my $mss = Koha::MarcSubfieldStructures->search( { tagfield => 952, tagsubfield => 'c', frameworkcode => '' } ); > $mss->delete if $mss; > $mss = Koha::MarcSubfieldStructures->search( { tagfield => 952, tagsubfield => 'c', frameworkcode => 'ACQ' } ); >@@ -153,15 +153,15 @@ subtest 'search_by_*_field + find_by_koha_field + get_description' => sub { > $mss->delete if $mss; > $mss = Koha::MarcSubfieldStructures->search( { tagfield => 952, tagsubfield => '5', frameworkcode => '' } ); > $mss->delete if $mss; >- Koha::AuthorisedValueCategory->new( { category_name => 'LOC' } )->store; >+ Koha::AuthorisedValueCategory->new( { category_name => 'TEST' } )->store; > Koha::AuthorisedValueCategory->new( { category_name => 'ANOTHER_4_TESTS' } )->store; >- Koha::MarcSubfieldStructure->new( { tagfield => 952, tagsubfield => 'c', frameworkcode => '', authorised_value => 'LOC', kohafield => 'items.location' } )->store; >- Koha::MarcSubfieldStructure->new( { tagfield => 952, tagsubfield => 'c', frameworkcode => 'ACQ', authorised_value => 'LOC', kohafield => 'items.location' } )->store; >+ Koha::MarcSubfieldStructure->new( { tagfield => 952, tagsubfield => 'c', frameworkcode => '', authorised_value => 'TEST', kohafield => 'items.location' } )->store; >+ Koha::MarcSubfieldStructure->new( { tagfield => 952, tagsubfield => 'c', frameworkcode => 'ACQ', authorised_value => 'TEST', kohafield => 'items.location' } )->store; > Koha::MarcSubfieldStructure->new( { tagfield => 952, tagsubfield => 'd', frameworkcode => '', authorised_value => 'ANOTHER_4_TESTS', kohafield => 'items.another_field' } )->store; > Koha::MarcSubfieldStructure->new( { tagfield => 952, tagsubfield => '5', frameworkcode => '', authorised_value => 'restricted_for_testing', kohafield => 'items.restricted' } )->store; >- Koha::AuthorisedValue->new( { category => 'LOC', authorised_value => 'location_1' } )->store; >- Koha::AuthorisedValue->new( { category => 'LOC', authorised_value => 'location_2' } )->store; >- Koha::AuthorisedValue->new( { category => 'LOC', authorised_value => 'location_3' } )->store; >+ Koha::AuthorisedValue->new( { category => 'TEST', authorised_value => 'location_1' } )->store; >+ Koha::AuthorisedValue->new( { category => 'TEST', authorised_value => 'location_2' } )->store; >+ Koha::AuthorisedValue->new( { category => 'TEST', authorised_value => 'location_3' } )->store; > Koha::AuthorisedValue->new( { category => 'ANOTHER_4_TESTS', authorised_value => 'an_av' } )->store; > Koha::AuthorisedValue->new( { category => 'ANOTHER_4_TESTS', authorised_value => 'another_av' } )->store; > subtest 'search_by_marc_field' => sub { >-- >2.20.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 17355
:
64102
|
65782
|
65869
|
65870
|
66022
|
66023
|
66024
|
103833
|
103834
|
103835
|
103836
|
103837
|
103838
|
104099
|
104100
|
104101
|
104102
|
104103
|
104104
|
104117
|
104118
|
104119
|
104120
|
104121
|
104122
|
104123
| 104352 |
104539