diff --git a/cadasta/config/settings/default.py b/cadasta/config/settings/default.py index e74219e9f..ca14dd7a7 100644 --- a/cadasta/config/settings/default.py +++ b/cadasta/config/settings/default.py @@ -350,8 +350,8 @@ } } -ICON_URL = ('https://s3-us-west-2.amazonaws.com/cadasta-platformprod' - '-bucket/icons/{}.png') +ICON_URL = ('https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/{}.png') ICON_LOOKUPS = { 'application/pdf': 'pdf', diff --git a/cadasta/resources/tests/test_migrations.py b/cadasta/resources/tests/test_migrations.py index 5a9a1746a..87a146f07 100644 --- a/cadasta/resources/tests/test_migrations.py +++ b/cadasta/resources/tests/test_migrations.py @@ -73,7 +73,7 @@ def setUpBeforeMigration(self, apps_before): project = Project.objects.create(name='Test Proj', organization=org) base_path = ( - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-bucket/' + 'https://s3-us-west-2.amazonaws.com/cadasta-resources/' ) # cannot call custom save methods on models in migrations @@ -97,7 +97,7 @@ def test_migration(self): resources = Resource.objects.filter(mime_type='text/csv') assert len(resources) == 10 base_path = ( - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-bucket/' + 'https://s3-us-west-2.amazonaws.com/cadasta-resources/' ) resource = Resource.objects.get(name='test-resource-0') assert resource.file.url == base_path + 'resources/test_0.csv' @@ -118,7 +118,7 @@ def setUpBeforeMigration(self, apps_before): project = Project.objects.create(name='Test Proj', organization=org) base_path = ( - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-bucket/' + 'https://s3-us-west-2.amazonaws.com/cadasta-resources/' 'resources/' ) diff --git a/cadasta/resources/tests/test_models.py b/cadasta/resources/tests/test_models.py index 3fcff61e2..8ee9b1643 100644 --- a/cadasta/resources/tests/test_models.py +++ b/cadasta/resources/tests/test_models.py @@ -64,8 +64,8 @@ def test_thumbnail_pdf(self): mime_type='application/pdf' ) assert (resource.thumbnail == - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-' - 'bucket/icons/pdf.png') + 'https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/pdf.png') def test_thumbnail_mp3(self): resource = ResourceFactory.build( @@ -73,32 +73,32 @@ def test_thumbnail_mp3(self): mime_type='audio/mpeg3' ) assert (resource.thumbnail == - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-' - 'bucket/icons/mp3.png') + 'https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/mp3.png') resource = ResourceFactory.build( file='http://example.com/dir/filename.mp3', mime_type='audio/x-mpeg-3' ) assert (resource.thumbnail == - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-' - 'bucket/icons/mp3.png') + 'https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/mp3.png') resource = ResourceFactory.build( file='http://example.com/dir/filename.mp3', mime_type='video/mpeg' ) assert (resource.thumbnail == - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-' - 'bucket/icons/mp3.png') + 'https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/mp3.png') resource = ResourceFactory.build( file='http://example.com/dir/filename.mp3', mime_type='video/x-mpeg' ) assert (resource.thumbnail == - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-' - 'bucket/icons/mp3.png') + 'https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/mp3.png') def test_thumbnail_mp4(self): resource = ResourceFactory.build( @@ -106,8 +106,8 @@ def test_thumbnail_mp4(self): mime_type='video/mp4' ) assert (resource.thumbnail == - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-' - 'bucket/icons/mp4.png') + 'https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/mp4.png') def test_thumbnail_doc(self): resource = ResourceFactory.build( @@ -115,8 +115,8 @@ def test_thumbnail_doc(self): mime_type='application/msword' ) assert (resource.thumbnail == - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-' - 'bucket/icons/doc.png') + 'https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/doc.png') def test_thumbnail_docx(self): resource = ResourceFactory.build( @@ -125,8 +125,8 @@ def test_thumbnail_docx(self): 'wordprocessingml.document') ) assert (resource.thumbnail == - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-' - 'bucket/icons/docx.png') + 'https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/docx.png') def test_thumbnail_xls(self): resource = ResourceFactory.build( @@ -134,16 +134,16 @@ def test_thumbnail_xls(self): mime_type='application/msexcel' ) assert (resource.thumbnail == - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-' - 'bucket/icons/xls.png') + 'https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/xls.png') resource = ResourceFactory.build( file='http://example.com/dir/filename.doc', mime_type='application/vnd.ms-excel' ) assert (resource.thumbnail == - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-' - 'bucket/icons/xls.png') + 'https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/xls.png') def test_thumbnail_xlsx(self): resource = ResourceFactory.build( @@ -152,16 +152,16 @@ def test_thumbnail_xlsx(self): '.spreadsheetml.sheet') ) assert (resource.thumbnail == - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-' - 'bucket/icons/xlsx.png') + 'https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/xlsx.png') def test_thumbnail_xml(self): resource = ResourceFactory.build( file='http://example.com/dir/filename.gpx', mime_type=('text/xml')) assert (resource.thumbnail == - 'https://s3-us-west-2.amazonaws.com/cadasta-platformprod-' - 'bucket/icons/xml.png') + 'https://s3-us-west-2.amazonaws.com/cadasta-resources' + '/icons/xml.png') def test_thumbnail_other(self): resource = ResourceFactory.build(