starting a test user/sandbergja/lp1940105-archive-course-should-detach_material
authorJane Sandberg <js7389@princeton.edu>
Thu, 9 Jun 2022 04:07:46 +0000 (21:07 -0700)
committerJane Sandberg <js7389@princeton.edu>
Thu, 9 Jun 2022 04:07:46 +0000 (21:07 -0700)
Open-ILS/src/perlmods/live_t/31-courses.t

index 8c3c517..e7a7832 100644 (file)
@@ -1,7 +1,7 @@
 #!perl
  
 use strict; use warnings;
-use Test::More tests => 5;
+use Test::More tests => 5; # TODO add the right number of tests
 use OpenILS::Utils::TestUtils;
 use OpenILS::Utils::CStoreEditor qw/:funcs/;
 use OpenILS::Application::AppUtils;
@@ -80,3 +80,25 @@ $results = $e->search_biblio_record_entry({tcn_source=>$temp_tcn_source,deleted=
 is(scalar(@$results), 0, 'Successfully deleted bre');
 
 
+# --------------------------------------------------------------------------
+# 3. Let's attach an existing item record entry to course #1, then delete it
+# --------------------------------------------------------------------------
+
+my $acmcm = Fieldmapper::asset::course_module_course_materials->new;
+$acmcm->course(1);
+$acmcm->id(9999);
+$acmcm->record(55);
+$acmcm->item(); # TODO add a value
+$acmcm->original_status(); # TODO add a status
+$acmcm->original_location(); # TODO add a location
+$acmcm->temporary_record(0);
+$e->create_asset_course_module_course_materials( $acmcm ); # associated this bib record with a course
+$e->commit;
+
+$apputils->simplereq('open-ils.courses', 'open-ils.courses.detach_material', $authtoken, 9999);
+
+my $results = $e->search_asset_course_module_course_materials({id => 9999}); #TODO fetch the acp
+is(scalar(@$results), 0, 'Successfully deleted acmcm'); #TODO check the acp status and location
+
+
+