def test_create_upload_endpoint(self): link_data = {'protocol': 'http'} self.jwp_client.videos.update.return_value.update({'link': link_data}) with mock.patch('mediaplatform_jwp.upload.record_link_response') as rlr_mock: management.create_upload_endpoint(self.jwp_item) self.assert_video_updated(self.jwp_item.jwp.key, update_file=True) rlr_mock.assert_called_once_with(link_data, self.jwp_item)
def test_create_upload_endpoint_requires_jwp_video(self): with self.assertRaises(ValueError): management.create_upload_endpoint(self.no_jwp_item)
def update(self, instance, verified_data): # TODO: abstract the creation of UploadEndpoint objects to be backend neutral management.create_upload_endpoint(instance) return instance