@@ -29,7 +29,7 @@ def test_oembed_for_dataset(self, api):
2929 '''It should fetch a dataset in the oembed format.'''
3030 dataset = DatasetFactory ()
3131
32- url = url_for ('api.oembed' , url = dataset .external_url )
32+ url = url_for ('api.oembed' , url = dataset .url_for () )
3333
3434 response = api .get (url , headers = {'Origin' : 'http://localhost' })
3535 assert200 (response )
@@ -49,7 +49,7 @@ def test_oembed_for_dataset_with_organization(self, api):
4949 organization = OrganizationFactory ()
5050 dataset = DatasetFactory (organization = organization )
5151
52- url = url_for ('api.oembed' , url = dataset .external_url )
52+ url = url_for ('api.oembed' , url = dataset .url_for () )
5353
5454 response = api .get (url , headers = {'Origin' : 'http://localhost' })
5555 assert200 (response )
@@ -91,7 +91,7 @@ def test_oembed_for_reuse(self, api):
9191 '''It should fetch a reuse in the oembed format.'''
9292 reuse = ReuseFactory ()
9393
94- url = url_for ('api.oembed' , url = reuse .external_url )
94+ url = url_for ('api.oembed' , url = reuse .url_for () )
9595 response = api .get (url , headers = {'Origin' : 'http://localhost' })
9696 assert200 (response )
9797 assert_cors (response )
@@ -109,7 +109,7 @@ def test_oembed_for_org(self, api):
109109 '''It should fetch an organization in the oembed format.'''
110110 org = OrganizationFactory ()
111111
112- url = url_for ('api.oembed' , url = org .external_url )
112+ url = url_for ('api.oembed' , url = org .url_for () )
113113 response = api .get (url , headers = {'Origin' : 'http://localhost' })
114114 assert200 (response )
115115 assert_cors (response )
@@ -145,7 +145,7 @@ def test_oembed_with_an_unknown_url(self, api):
145145 def test_oembed_with_port_in_https_url (self , api ):
146146 '''It should works on HTTPS URLs with explicit port.'''
147147 dataset = DatasetFactory ()
148- url = dataset .external_url .replace ('http://local.test/' ,
148+ url = dataset .url_for () .replace ('http://local.test/' ,
149149 'https://local.test:443/' )
150150 api_url = url_for ('api.oembed' , url = url )
151151
@@ -154,7 +154,7 @@ def test_oembed_with_port_in_https_url(self, api):
154154 def test_oembed_does_not_support_xml (self , api ):
155155 '''It does not support xml format.'''
156156 dataset = DatasetFactory ()
157- url = url_for ('api.oembed' , url = dataset .external_url , format = 'xml' )
157+ url = url_for ('api.oembed' , url = dataset .url_for () , format = 'xml' )
158158 response = api .get (url , headers = {'Origin' : 'http://localhost' })
159159 assert_status (response , 501 )
160160 assert_cors (response )
@@ -213,7 +213,7 @@ def test_oembeds_dataset_api_get(self, api):
213213 assert data ['type' ] == 'rich'
214214 assert data ['version' ] == '1.0'
215215 assert dataset .title in data ['html' ]
216- assert dataset .external_url in data ['html' ]
216+ assert dataset .url_for () in data ['html' ]
217217 assert 'placeholders/default.png' in data ['html' ]
218218 assert mdstrip (dataset .description , 110 ) in data ['html' ]
219219
@@ -228,7 +228,7 @@ def test_oembeds_dataset_api_get_with_organization(self, api):
228228 assert200 (response )
229229 data = response .json [0 ]
230230 assert organization .name in data ['html' ]
231- assert organization .external_url in data ['html' ]
231+ assert organization .url_for () in data ['html' ]
232232
233233 def test_oembeds_dataset_api_get_without_references (self , api ):
234234 '''It should fail at fetching an oembed without a dataset.'''
0 commit comments