+# try to produce something for our lunar warehouse, but parts are only available on earth
+dies_ok(sub {
+SL::Helper::Inventory::produce_assembly(
+ part => $assembly1,
+ qty => 1,
+ auto_allocate => 1,
+ # where to put it
+ bin => $bin_moon,
+ chargenumber => "Lunar Dust inside",
+);
+}, "producing for wrong warehouse dies");
+
+# same test, but check exception class
+throws_ok{
+SL::Helper::Inventory::produce_assembly(
+ part => $assembly1,
+ qty => 1,
+ auto_allocate => 1,
+ # where to put it
+ bin => $bin_moon,
+ chargenumber => "Lunar Dust inside",
+);
+ } "SL::X::Inventory::Allocation", "producing for wrong warehouse throws correct error class";
+
+# same test, but check user feedback for the error message
+throws_ok{
+SL::Helper::Inventory::produce_assembly(
+ part => $assembly1,
+ qty => 1,
+ auto_allocate => 1,
+ # where to put it
+ bin => $bin_moon,
+ chargenumber => "Lunar Dust inside",
+);
+ } qr/Part ap (1|2) Testpart (1|2) exists in warehouse Warehouse, but not in warehouse Our warehouse location at the moon/, "producing for wrong warehouse throws correct error message";
+