Lines 906-927
sub test_checkout_desensitize {
Link Here
|
906 |
|
906 |
|
907 |
undef $response; |
907 |
undef $response; |
908 |
my $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
908 |
my $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
909 |
$server->{account}->{never_demagnitize} = "A,$patron_category,Z"; |
909 |
$server->{account}->{inhouse_patron_categories} = "A,$patron_category,Z"; |
910 |
$msg->handle_checkout( $server ); |
910 |
$msg->handle_checkout( $server ); |
911 |
my $respcode = substr( $response, 5, 1 ); |
911 |
my $respcode = substr( $response, 5, 1 ); |
912 |
is( $respcode, 'N', "Desensitize flag was not set for patron category in never_demagnitize" ); |
912 |
is( $respcode, 'N', "Desensitize flag was not set for patron category in inhouse_patron_categories" ); |
913 |
|
913 |
|
914 |
undef $response; |
914 |
undef $response; |
915 |
$server->{account}->{never_demagnitize} = "A,B,C"; |
915 |
$server->{account}->{inhouse_patron_categories} = "A,B,C"; |
916 |
$msg->handle_checkout( $server ); |
916 |
$msg->handle_checkout( $server ); |
917 |
$respcode = substr( $response, 5, 1 ); |
917 |
$respcode = substr( $response, 5, 1 ); |
918 |
is( $respcode, 'Y', "Desensitize flag was set for patron category not in never_demagnitize" ); |
918 |
is( $respcode, 'Y', "Desensitize flag was set for patron category not in inhouse_patron_categories" ); |
919 |
|
919 |
|
920 |
undef $response; |
920 |
undef $response; |
921 |
$server->{account}->{never_demagnitize} = ""; |
921 |
$server->{account}->{inhouse_patron_categories} = ""; |
922 |
$msg->handle_checkout( $server ); |
922 |
$msg->handle_checkout( $server ); |
923 |
$respcode = substr( $response, 5, 1 ); |
923 |
$respcode = substr( $response, 5, 1 ); |
924 |
is( $respcode, 'Y', "Desensitize flag was set for empty never_demagnitize" ); |
924 |
is( $respcode, 'Y', "Desensitize flag was set for empty inhouse_patron_categories" ); |
925 |
} |
925 |
} |
926 |
|
926 |
|
927 |
sub test_renew_desensitize { |
927 |
sub test_renew_desensitize { |
Lines 972-993
sub test_renew_desensitize {
Link Here
|
972 |
|
972 |
|
973 |
undef $response; |
973 |
undef $response; |
974 |
my $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
974 |
my $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
975 |
$server->{account}->{never_demagnitize} = "A,$patron_category,Z"; |
975 |
$server->{account}->{inhouse_patron_categories} = "A,$patron_category,Z"; |
976 |
$msg->handle_checkout( $server ); |
976 |
$msg->handle_checkout( $server ); |
977 |
my $respcode = substr( $response, 5, 1 ); |
977 |
my $respcode = substr( $response, 5, 1 ); |
978 |
is( $respcode, 'N', "Desensitize flag was not set for patron category in never_demagnitize" ); |
978 |
is( $respcode, 'N', "Desensitize flag was not set for patron category in inhouse_patron_categories" ); |
979 |
|
979 |
|
980 |
undef $response; |
980 |
undef $response; |
981 |
$server->{account}->{never_demagnitize} = "A,B,C"; |
981 |
$server->{account}->{inhouse_patron_categories} = "A,B,C"; |
982 |
$msg->handle_checkout( $server ); |
982 |
$msg->handle_checkout( $server ); |
983 |
$respcode = substr( $response, 5, 1 ); |
983 |
$respcode = substr( $response, 5, 1 ); |
984 |
is( $respcode, 'Y', "Desensitize flag was set for patron category not in never_demagnitize" ); |
984 |
is( $respcode, 'Y', "Desensitize flag was set for patron category not in inhouse_patron_categories" ); |
985 |
|
985 |
|
986 |
undef $response; |
986 |
undef $response; |
987 |
$server->{account}->{never_demagnitize} = ""; |
987 |
$server->{account}->{inhouse_patron_categories} = ""; |
988 |
$msg->handle_checkout( $server ); |
988 |
$msg->handle_checkout( $server ); |
989 |
$respcode = substr( $response, 5, 1 ); |
989 |
$respcode = substr( $response, 5, 1 ); |
990 |
is( $respcode, 'Y', "Desensitize flag was set for empty never_demagnitize" ); |
990 |
is( $respcode, 'Y', "Desensitize flag was set for empty inhouse_patron_categories" ); |
991 |
} |
991 |
} |
992 |
|
992 |
|
993 |
# Helper routines |
993 |
# Helper routines |
994 |
- |
|
|