Commit 5439a303 authored by Jérome Perrin's avatar Jérome Perrin

cleanup unused imports

add test asURL Method on email


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15880 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e88a816c
...@@ -27,26 +27,15 @@ ...@@ -27,26 +27,15 @@
############################################################################## ##############################################################################
import os import unittest
from zLOG import LOG
from Testing import ZopeTestCase
from DateTime import DateTime from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type.Utils import convertToUpperCase from Products.ERP5Type.Utils import convertToUpperCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
class TestHR(ERP5TypeTestCase): class TestHR(ERP5TypeTestCase):
""" """
ERP5 Human Ressources related tests. ERP5 Human Ressources related tests.
...@@ -95,9 +84,8 @@ class TestHR(ERP5TypeTestCase): ...@@ -95,9 +84,8 @@ class TestHR(ERP5TypeTestCase):
## Usefull methods ## Usefull methods
################################## ##################################
def login(self, quiet=QUIET, run=RUN_ALL_TEST): def login(self):
""" """Create a new manager user and login.
Create a new manager user and login.
""" """
user_name = 'kevin' user_name = 'kevin'
user_folder = self.getPortal().acl_users user_folder = self.getPortal().acl_users
...@@ -877,11 +865,15 @@ class TestHR(ERP5TypeTestCase): ...@@ -877,11 +865,15 @@ class TestHR(ERP5TypeTestCase):
self.assertEquals('', pers.newContent(portal_type='Fax').asText()) self.assertEquals('', pers.newContent(portal_type='Fax').asText())
if __name__ == '__main__': def test_EmailAsURL(self):
framework() # asURL method works on email
else: pers = self.getPersonModule().newContent(portal_type='Person')
import unittest pers.setDefaultEmailText('nobody@example.com')
def test_suite(): email = per.getDefaultEmailValue()
suite = unittest.TestSuite() self.assertEquals('mailto:nobody@example.com', email.asURL())
suite.addTest(unittest.makeSuite(TestHR))
return suite
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestHR))
return suite
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