          """
          self.assertEqual(self.storage.url('test.file'),
              '%s%s' % (self.storage.base_url, 'test.file'))
  
          self.storage.base_url = None
          self.assertRaises(ValueError, self.storage.url, 'test.file')
  
      def test_file_with_mixin(self):
 
</s> remove         return urlparse.urljoin(self.base_url, name).replace('\\', '/')
 </s> add         return urlparse.urljoin(self.base_url, filepath_to_uri(name)) </s> remove from django.utils.encoding import force_unicode
 </s> add from django.utils.encoding import force_unicode, filepath_to_uri
        # should encode special chars except ~!*()'
        # like encodeURIComponent() JavaScript function do
        self.assertEqual(self.storage.url(r"""~!*()'@#$%^&*abc`+=.file"""),
            """/test_media_url/~!*()'%40%23%24%25%5E%26*abc%60%2B%3D.file""")

        # should stanslate os path separator(s) to the url path separator
        self.assertEqual(self.storage.url("""a/b\\c.file"""),
            """/test_media_url/a/b/c.file""")

          """
          self.assertEqual(self.storage.url('test.file'),
              '%s%s' % (self.storage.base_url, 'test.file'))
  
        # should encode special chars except ~!*()'
        # like encodeURIComponent() JavaScript function do
        self.assertEqual(self.storage.url(r"""~!*()'@#$%^&*abc`+=.file"""),
            """/test_media_url/~!*()'%40%23%24%25%5E%26*abc%60%2B%3D.file""")

        # should stanslate os path separator(s) to the url path separator
        self.assertEqual(self.storage.url("""a/b\\c.file"""),
            """/test_media_url/a/b/c.file""")

          self.storage.base_url = None
          self.assertRaises(ValueError, self.storage.url, 'test.file')
  
      def test_file_with_mixin(self):
keep keep keep add keep keep keep keep
 Fixed #15181 -- Ensure that special characters are escaped when querying for the URL of an uploaded file. Thanks to e.generalov for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15409 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
tests/regressiontests/file_storage/tests.py