Commit 72017bc3 authored by Nicolas Dumazet's avatar Nicolas Dumazet

remove trailing whitespaces


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38679 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 24984d8a
############################################################################## ##############################################################################
# #
# Copyright (c) 2004, 2005, 2006 Nexedi SARL and Contributors. # Copyright (c) 2004, 2005, 2006 Nexedi SARL and Contributors.
# All Rights Reserved. # All Rights Reserved.
# Romain Courteaud <romain@nexedi.com> # Romain Courteaud <romain@nexedi.com>
# #
...@@ -46,7 +46,7 @@ try: ...@@ -46,7 +46,7 @@ try:
setGlobalTranslationService setGlobalTranslationService
def unregister_translation_domain_fallback(): def unregister_translation_domain_fallback():
"""dummy function to keep the beforeTearDown() code neat""" """dummy function to keep the beforeTearDown() code neat"""
except ImportError: except ImportError:
# Zope 2.12, simulate setting the globalTranslationService with # Zope 2.12, simulate setting the globalTranslationService with
# zope.i18n utilities # zope.i18n utilities
...@@ -55,20 +55,20 @@ except ImportError: ...@@ -55,20 +55,20 @@ except ImportError:
import Acquisition import Acquisition
global_translation_service = None global_translation_service = None
from zope.i18n.interfaces import ITranslationDomain, \ from zope.i18n.interfaces import ITranslationDomain, \
IFallbackTranslationDomainFactory IFallbackTranslationDomainFactory
class DummyTranslationDomainFallback(object): class DummyTranslationDomainFallback(object):
zope.interface.implements(ITranslationDomain) zope.interface.implements(ITranslationDomain)
zope.interface.classProvides(IFallbackTranslationDomainFactory) zope.interface.classProvides(IFallbackTranslationDomainFactory)
def __init__(self, domain): def __init__(self, domain):
self.domain = domain self.domain = domain
def translate(self, msgid, mapping=None, *args, **kw): def translate(self, msgid, mapping=None, *args, **kw):
return global_translation_service.translate(self.domain, msgid, mapping, return global_translation_service.translate(self.domain, msgid, mapping,
*args, **kw) *args, **kw)
def setGlobalTranslationService(translation_service): def setGlobalTranslationService(translation_service):
global global_translation_service global global_translation_service
global_translation_service = translation_service global_translation_service = translation_service
...@@ -76,7 +76,7 @@ except ImportError: ...@@ -76,7 +76,7 @@ except ImportError:
provides=IFallbackTranslationDomainFactory) provides=IFallbackTranslationDomainFactory)
# disable translation for the 'ui' domain so it can use the fallback above. # disable translation for the 'ui' domain so it can use the fallback above.
# Save it on a portal attribute since we don't have access to the test # Save it on a portal attribute since we don't have access to the test
# class # class
sm = zope.component.getSiteManager() sm = zope.component.getSiteManager()
portal = Acquisition.aq_parent(sm) portal = Acquisition.aq_parent(sm)
ui_domain = sm.getUtility(ITranslationDomain, name='ui') ui_domain = sm.getUtility(ITranslationDomain, name='ui')
...@@ -155,8 +155,8 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -155,8 +155,8 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
object_title='UnitTest' object_title='UnitTest'
module_id='unittest_module' module_id='unittest_module'
module_title='UnitTests' module_title='UnitTests'
skins_tool = self.portal.portal_skins skins_tool = self.portal.portal_skins
types_tool = self.portal.portal_types types_tool = self.portal.portal_types
self.failIf(self.portal._getOb(module_id, None) is not None) self.failIf(self.portal._getOb(module_id, None) is not None)
...@@ -177,14 +177,14 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -177,14 +177,14 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
self.assertNotEqual(types_tool.getTypeInfo(object_portal_type), None) self.assertNotEqual(types_tool.getTypeInfo(object_portal_type), None)
self.assertTrue(module_portal_type self.assertTrue(module_portal_type
in self.portal.getPortalModuleTypeList()) in self.portal.getPortalModuleTypeList())
skin_folder = skins_tool._getOb(portal_skins_folder, None) skin_folder = skins_tool._getOb(portal_skins_folder, None)
self.assertNotEqual(skin_folder, None) self.assertNotEqual(skin_folder, None)
self.assert_('UnitTest_view' in skin_folder.objectIds()) self.assert_('UnitTest_view' in skin_folder.objectIds())
view_form = skin_folder.UnitTest_view view_form = skin_folder.UnitTest_view
self.assertEquals('form_view', view_form.pt) self.assertEquals('form_view', view_form.pt)
self.assertEquals('Base_edit', view_form.action) self.assertEquals('Base_edit', view_form.action)
self.assert_('UnitTestModule_viewUnitTestList' in skin_folder.objectIds()) self.assert_('UnitTestModule_viewUnitTestList' in skin_folder.objectIds())
list_form = skin_folder.UnitTestModule_viewUnitTestList list_form = skin_folder.UnitTestModule_viewUnitTestList
self.assertEquals('form_list', list_form.pt) self.assertEquals('form_list', list_form.pt)
...@@ -216,7 +216,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -216,7 +216,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
for action in actions for action in actions
if action['visible']] if action['visible']]
msg = ("Actions do not match. Expected:\n%s\n\nGot:\n%s\n" % msg = ("Actions do not match. Expected:\n%s\n\nGot:\n%s\n" %
(pprint.pformat(expected), pprint.pformat(got))) (pprint.pformat(expected), pprint.pformat(got)))
self.assertEquals(expected, got, msg) self.assertEquals(expected, got, msg)
def test_manager_actions_on_portal(self): def test_manager_actions_on_portal(self):
...@@ -284,7 +284,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -284,7 +284,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
""" """
response = self.publish('%s/view' % self.portal_id, self.auth) response = self.publish('%s/view' % self.portal_id, self.auth)
self.assertEquals(HTTP_OK, response.getStatus()) self.assertEquals(HTTP_OK, response.getStatus())
def test_login_form(self): def test_login_form(self):
"""Test anonymous user are redirected to login_form """Test anonymous user are redirected to login_form
""" """
...@@ -302,7 +302,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -302,7 +302,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
response = self.publish('%s/%s/view' % (self.portal_id, tool), self.auth) response = self.publish('%s/%s/view' % (self.portal_id, tool), self.auth)
self.assertEquals(HTTP_OK, response.getStatus(), self.assertEquals(HTTP_OK, response.getStatus(),
"%s: %s" % (tool, response.getStatus())) "%s: %s" % (tool, response.getStatus()))
def test_allowed_content_types_translated(self): def test_allowed_content_types_translated(self):
"""Tests allowed content types from the action menu are translated""" """Tests allowed content types from the action menu are translated"""
translation_service = DummyTranslationService() translation_service = DummyTranslationService()
...@@ -344,7 +344,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -344,7 +344,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
""" """
test getDefaultModule method test getDefaultModule method
""" """
if not run: if not run:
return return
portal_id = self.getPortal().getId() portal_id = self.getPortal().getId()
object_portal_type = ' '.join([part.capitalize() for part \ object_portal_type = ' '.join([part.capitalize() for part \
...@@ -354,7 +354,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -354,7 +354,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
object_title=object_portal_type object_title=object_portal_type
module_id="%s_module" % portal_id module_id="%s_module" % portal_id
module_title='%ss' % object_portal_type module_title='%ss' % object_portal_type
# Create module for testing # Create module for testing
self.failIf(self.portal._getOb(module_id, None) is not None) self.failIf(self.portal._getOb(module_id, None) is not None)
self.assertEqual(self.portal.portal_skins._getOb(portal_skins_folder, None), self.assertEqual(self.portal.portal_skins._getOb(portal_skins_folder, None),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment