Skip to content

Commit

Permalink
fixed tests for catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
titima15 committed Dec 20, 2022
1 parent acaaaec commit a348db9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 21 deletions.
32 changes: 17 additions & 15 deletions sgn_test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,23 @@ solyc_conversion_files /home/production/solcyc_conversion_files/tomato_unigenes_
search_path gem
</DatabaseConnection>


#ODK Services
odk_crossing_data_service_name ONA
odk_crossing_data_service_url https://ona.io
odk_crossing_data_service_username seedtracker
odk_crossing_data_service_password Seedtracking101
odk_crossing_data_form_name BTractTest
odk_crossing_data_test_form_name NULL
odk_crossing_data_separate_wishlist_by_location 1
odk_phenotyping_data_service_name NULL
odk_phenotyping_data_service_url https://bio.smap.com.au
odk_phenotyping_data_service_username SMAPUSER
odk_phenotyping_data_service_password SMAPPASS
crontab_file NULL
crontab_log_filepath NULL
order_properties Quantity,Comments
order_properties_dialog Quantity,Comments

##ODK Services
##odk_crossing_data_service_name NULL
##odk_crossing_data_service_url https://ona.io
##odk_crossing_data_service_username seedtracker
##odk_crossing_data_service_password Seedtracking101
##odk_crossing_data_form_name BTractTest
##odk_crossing_data_test_form_name NULL
##odk_crossing_data_separate_wishlist_by_location 1
##odk_phenotyping_data_service_name NULL
##odk_phenotyping_data_service_url https://bio.smap.com.au
##odk_phenotyping_data_service_username SMAPUSER
##odk_phenotyping_data_service_password SMAPPASS
##crontab_file NULL
##crontab_log_filepath NULL


noaa_ncdc_access_token DLPxdOEIwKyoiMSuQMRYrtMaiIUpNAwk
Expand Down
Binary file modified t/data/stock/catalog_items.xls
Binary file not shown.
Binary file modified t/data/stock/catalog_items.xlsx
Binary file not shown.
27 changes: 21 additions & 6 deletions t/unit_fixture/CXGN/Stock/CatalogOrder.t
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,33 @@ for my $extension ("xls", "xlsx") {

my $program_id = $schema->resultset('Project::Project')->find({ name => 'test' })->project_id();

my $item_id = $schema->resultset("Stock::Stock")->find({ name => 'UG120001' })->stock_id();
my $item_rs = $schema->resultset("Stock::Stock")->find({ name => 'UG120001' });
my $item_id = $item_rs->stock_id();
my $stock_catalog = CXGN::Stock::Catalog->new({
bcs_schema => $schema,
parent_id => $item_id,
});

my $variety_type_id = SGN::Model::Cvterm->get_cvterm_row($schema, 'variety', 'stock_property')->cvterm_id();
my $organism_id = $item_rs->organism_id();
my $organism = $schema->resultset("Organism::Organism")->find({organism_id => $organism_id});
my $item_species = $organism->species();
my $item_variety;
my $item_stockprop = $schema->resultset("Stock::Stockprop")->find({stock_id => $item_id, type_id => $variety_type_id});
if ($item_stockprop) {
$item_variety = $item_stockprop->value();
} else {
$item_variety = 'NA';
}

$stock_catalog->item_type('single item');
$stock_catalog->material_type('plant');
$stock_catalog->material_source('BTI');
$stock_catalog->category('released variety');
$stock_catalog->description('test item');
$stock_catalog->material_source('Sendusu');
$stock_catalog->species($item_species);
$stock_catalog->variety($item_variety);
$stock_catalog->breeding_program($program_id);
$stock_catalog->availability('in stock');
$stock_catalog->additional_info('test adding info');
$stock_catalog->contact_person_id($johndoe_id);

ok($stock_catalog->store(), "check adding catalog");
Expand Down Expand Up @@ -107,10 +122,10 @@ for my $extension ("xls", "xlsx") {
bcs_schema => $schema,
item_type => $catalog_info_hash{item_type},
category => $catalog_info_hash{category},
description => $catalog_info_hash{description},
material_type => $catalog_info_hash{material_type},
material_source => $catalog_info_hash{material_source},
breeding_program => $catalog_info_hash{breeding_program},
availability => $catalog_info_hash{availability},
additional_info => $catalog_info_hash{additional_info},
contact_person_id => $catalog_info_hash{contact_person_id},
parent_id => $stock_id
});
Expand Down

0 comments on commit a348db9

Please sign in to comment.