]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/perlmods/live_t/21-batch-org-settings.t
LP 1780660: Add more workstation functions to OpenILS::Utils::TestUtils.
[Evergreen.git] / Open-ILS / src / perlmods / live_t / 21-batch-org-settings.t
1 #!perl
2 use strict; use warnings;
3 use Test::More tests => 180; # 15 orgs * 12 settings
4 use OpenILS::Utils::TestUtils;
5 use OpenILS::Application::AppUtils;
6 my $U = 'OpenILS::Application::AppUtils';
7
8 diag("Tests batch org setting retrieval");
9
10 my $script = OpenILS::Utils::TestUtils->new();
11 $script->bootstrap;
12
13 my $org_ids = [1 .. 15];
14 # All settings at time of writing.  None of these have view perms.
15 my @settings = qw/
16     circ.patron_search.diacritic_insensitive
17     circ.checkout_auto_renew_age
18     cat.label.font.weight
19     cat.spine.line.height
20     circ.grace.extend
21     cat.label.font.size
22     circ.booking_reservation.default_elbow_room
23     cat.spine.line.width
24     lib.info_url
25     circ.hold_go_home_interval
26     cat.label.font.family
27     cat.spine.line.margin
28 /;
29
30 # compare the values returned from the batch-by-org setting to the
31 # traditional setting value lookup call.
32 for my $setting (@settings) {
33     my %batch_settings = 
34         $U->ou_ancestor_setting_batch_by_org_insecure($org_ids, $setting);
35
36     for my $org_id (@$org_ids) {
37         my $value = $U->ou_ancestor_setting_value($org_id, $setting);
38         is($value, $batch_settings{$org_id}->{value}, 
39             "Value matches for setting $setting and org $org_id");
40     }
41 }
42
43