예제 #1
0
 def testPreferredCharsetResolverWithoutRequestAndWithEncoding(self):
     # This test checks the edgecase where the unicode conflict resolver
     # is called with a context object having no REQUEST
     class ContextMock:
         management_page_charset = 'iso-8859-15'
     result = PreferredCharsetResolver.resolve(ContextMock(), '�צה', None)
     self.assertEqual(result, u'�צה')
 def testPreferredCharsetResolverWithoutRequestAndWithEncoding(self):
     # This test checks the edgecase where the unicode conflict resolver
     # is called with a context object having no REQUEST
     class ContextMock:
         management_page_charset = 'utf-8'
     result = PreferredCharsetResolver.resolve(ContextMock(), '�צה', None)
     self.assertEqual(result, '�צה')
예제 #3
0
 def testPreferredCharsetResolverWithoutRequestAndWithoutEncoding(self):
     # This test checks the edgecase where the unicode conflict resolver
     # is called with a context object having no REQUEST
     # Since switching from ``management_page_charset`` set on the
     # REQUEST to the ``default-zpublisher-encoding`` configuration
     # setting that is always available, this test will return a
     # correctly decoded value.
     context = object()
     result = PreferredCharsetResolver.resolve(context, 'üöä', None)
     self.assertEqual(result, 'üöä')
예제 #4
0
 def testPreferredCharsetResolverWithoutRequestAndWithoutEncoding(self):
     # This test checks the edgecase where the unicode conflict resolver
     # is called with a context object having no REQUEST
     # Since switching from ``management_page_charset`` set on the
     # REQUEST to the ``default-zpublisher-encoding`` configuration
     # setting that is always available, this test will return a
     # correctly decoded value.
     context = object()
     result = PreferredCharsetResolver.resolve(context, 'üöä', None)
     self.assertEqual(result, u'üöä')
예제 #5
0
 def testPreferredCharsetResolverWithoutRequestAndWithoutEncoding(self):
     # This test checks the edgecase where the unicode conflict resolver
     # is called with a context object having no REQUEST
     context = object()
     result = PreferredCharsetResolver.resolve(context, '�צה', None)
     self.assertEqual(result, '�צה')
 def testPreferredCharsetResolverWithoutRequestAndWithoutEncoding(self):
     # This test checks the edgecase where the unicode conflict resolver
     # is called with a context object having no REQUEST
     context = object()
     result = PreferredCharsetResolver.resolve(context, '�צה', None)
     self.assertEqual(result, '�צה')