def get_url(self, path): """ Given the path of a file in the store, return a URL to the file. Path will be prefixed by `self.path_prefix`. """ return to_absolute_api_url( settings.MEDIA_URL, self.get_full_path(path)) # pragma: no cover
def test_to_absolute_api_url_bad_input(self): with self.assertRaises(ValueError): to_absolute_api_url('abc/def', 'g')
def test_to_absolute_api_url(self, inputs, expected_output): self.assertEqual(to_absolute_api_url(*inputs), expected_output)