示例#1
0
 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
示例#2
0
 def test_to_absolute_api_url_bad_input(self):
     with self.assertRaises(ValueError):
         to_absolute_api_url('abc/def', 'g')
示例#3
0
 def test_to_absolute_api_url(self, inputs, expected_output):
     self.assertEqual(to_absolute_api_url(*inputs), expected_output)