LP#1774277 Acq requests live test vandelay repair
authorBill Erickson <berickxx@gmail.com>
Thu, 6 Sep 2018 14:24:14 +0000 (10:24 -0400)
committerBen Shum <ben@evergreener.net>
Thu, 6 Sep 2018 14:52:47 +0000 (10:52 -0400)
Acq requests test now logs in with a workstation since under the covers
vandelay (used for acq imports) requires a workstation on the new
tracker tables.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Ben Shum <ben@evergreener.net>
Open-ILS/src/perlmods/live_t/22-acq-requests.t

index 2fc3d89..52c6f7f 100644 (file)
@@ -5,15 +5,35 @@ use OpenILS::Utils::TestUtils;
 use OpenILS::Utils::CStoreEditor qw/:funcs/;
 use OpenILS::Application::Acq::Order;
 
+use constant WORKSTATION_LIB => 4;
+use constant WORKSTATION_NAME => 'BR1-test-22-acq-reqs';
+
 diag("Tests ACQ purchase requests");
 
 my $script = OpenILS::Utils::TestUtils->new();
 $script->bootstrap;
+my $e = new_editor();
+$e->init;
+
+my $workstation = $e->search_actor_workstation(
+    {name => WORKSTATION_NAME, owning_lib => WORKSTATION_LIB})->[0];
+
+if (!$workstation) {
+    $script->authenticate({
+        username => 'admin',
+        password => 'demo123',
+        type => 'staff'
+    });
+
+    my $ws = $script->register_workstation(WORKSTATION_NAME, WORKSTATION_LIB);
+    $script->logout();
+}
 
 $script->authenticate({
     username => 'admin',
     password => 'demo123',
-    type => 'staff'
+    type => 'staff',
+    workstation => WORKSTATION_NAME
 });
 
 my $ses = $script->session('open-ils.storage');