fix for the failing unit test
@@ -348,6 +348,8 @@ class CompositeResourceTest(MockIRODSTestCaseMixin, TransactionTestCase):
self.raster_file_obj = open(self.raster_file, 'r')
resource_file_add_process(resource=self.composite_resource,
files=(self.raster_file_obj,), user=self.user)
+
+ self.assertEqual(self.composite_resource.files.all().count(), 2)
# add some core metadata
# create abstract
metadata = self.composite_resource.metadata
@@ -394,7 +396,10 @@ class CompositeResourceTest(MockIRODSTestCaseMixin, TransactionTestCase):
value_dict = {'east': '56.45678', 'north': '12.6789', 'units': 'decimal deg'}
gen_logical_file.metadata.create_element('coverage', type='point', value=value_dict)
- GeoRasterLogicalFile.set_file_type(self.composite_resource, res_file.id, self.user)
+ tif_res_file = [f for f in self.composite_resource.files.all()
+ if f.extension == ".tif"][0]
+
+ GeoRasterLogicalFile.set_file_type(self.composite_resource, tif_res_file.id, self.user)
# add generic logical file type metadata
res_file = [f for f in self.composite_resource.files.all()
if f.logical_file_type_name == "GeoRasterLogicalFile"][0]
