LP1952931 ASN shipment notifiation Perl Test
authorBill Erickson <berickxx@gmail.com>
Fri, 3 Dec 2021 23:00:32 +0000 (18:00 -0500)
committerJane Sandberg <sandbergja@gmail.com>
Thu, 20 Oct 2022 13:56:09 +0000 (06:56 -0700)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/live_t/35-acq-asn-edi.t [new file with mode: 0755]

diff --git a/Open-ILS/src/perlmods/live_t/35-acq-asn-edi.t b/Open-ILS/src/perlmods/live_t/35-acq-asn-edi.t
new file mode 100755 (executable)
index 0000000..19109f7
--- /dev/null
@@ -0,0 +1,48 @@
+#!/usr/bin/perl
+use strict; use warnings;
+use OpenILS::Utils::TestUtils;
+use OpenILS::Utils::CStoreEditor (':funcs');
+use OpenILS::Utils::Fieldmapper;
+
+use Test::More tests => 5;
+
+diag("Tests EDI Shipment Notifications");
+
+use constant {
+    BR1_ID => 4,
+    BIB_ID => 248,
+    PROVIDER_ID => 2,
+    ADMIN_USER => 'admin',
+    ADMIN_PASS => 'demo123'
+};
+
+my $U = 'OpenILS::Application::AppUtils';
+my $script = OpenILS::Utils::TestUtils->new();
+$script->bootstrap;
+
+my $e = new_editor;
+$e->init;
+
+$script->authenticate({
+    username => ADMIN_USER,
+    password => ADMIN_PASS,
+    type => 'staff'
+});
+
+BAIL_OUT('Failed to Login') unless $script->authtoken;
+
+
+sub create_po {
+    
+    my $li = Fieldmapper::acq::lineitem->new;
+    $li->eg_bib_id(BIB_ID);
+    $li->marc('<record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns="http://www.loc.gov/MARC21/slim"><leader>         a              </leader><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9780307887436</subfield></record>');
+    $li->
+
+    my $po = Fieldmapper::acq::purchase_order->new;
+    $po->ordering_agency(BR1_ID);
+    $po->provider(PROVIDER_ID);
+    $po->name("ASN-Test");
+}
+
+