Пример #1
0
 def test_attfnboth3(self):
     params = {
         'filename*0*': "ISO-8859-15''euro-sign%3d%a4",
         'filename*': 'currency-sign=¤'
     }
     self.assertEqual('currency-sign=¤',
                      multipart.content_disposition_filename(params))
Пример #2
0
 def test_attrfc2047quoted(self):
     params = {'filename': '=?ISO-8859-1?Q?foo-=E4.html?='}
     self.assertEqual('=?ISO-8859-1?Q?foo-=E4.html?=',
                      multipart.content_disposition_filename(params))
Пример #3
0
 def test_attfnboth(self):
     params = {'filename': 'foo-ae.html', 'filename*': 'foo-ä.html'}
     self.assertEqual('foo-ä.html',
                      multipart.content_disposition_filename(params))
Пример #4
0
 def test_attfncontlz(self):
     params = {'filename*0': 'foo', 'filename*01': 'bar'}
     self.assertEqual('foo', multipart.content_disposition_filename(params))
Пример #5
0
 def test_attfnconts1(self):
     params = {'filename*1': 'foo', 'filename*2': 'bar'}
     self.assertEqual(None, multipart.content_disposition_filename(params))
Пример #6
0
 def test_attfncontenc(self):
     params = {'filename*0*': "UTF-8''foo-%c3%a4", 'filename*1': '.html'}
     self.assertEqual(u'foo-ä.html',
                      multipart.content_disposition_filename(params))
Пример #7
0
 def test_attfncont(self):
     params = {'filename*0': 'foo.', 'filename*1': 'html'}
     self.assertEqual('foo.html',
                      multipart.content_disposition_filename(params))
Пример #8
0
 def test_filename_ext(self):
     params = {'filename*': 'файл.html'}
     self.assertEqual('файл.html',
                      multipart.content_disposition_filename(params))
Пример #9
0
 def test_filename(self):
     params = {'filename': 'foo.html'}
     self.assertEqual('foo.html',
                      multipart.content_disposition_filename(params))
Пример #10
0
 def test_no_filename(self):
     self.assertIsNone(multipart.content_disposition_filename({}))
     self.assertIsNone(
         multipart.content_disposition_filename({'foo': 'bar'}))