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 @@
##############################################################################
import os
from zLOG import LOG
from Testing import ZopeTestCase
import unittest
from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type.Utils import convertToUpperCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList
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):
"""
ERP5 Human Ressources related tests.
......@@ -95,9 +84,8 @@ class TestHR(ERP5TypeTestCase):
## Usefull methods
##################################
def login(self, quiet=QUIET, run=RUN_ALL_TEST):
"""
Create a new manager user and login.
def login(self):
"""Create a new manager user and login.
"""
user_name = 'kevin'
user_folder = self.getPortal().acl_users
......@@ -877,11 +865,15 @@ class TestHR(ERP5TypeTestCase):
self.assertEquals('', pers.newContent(portal_type='Fax').asText())
if __name__ == '__main__':
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestHR))
return suite
def test_EmailAsURL(self):
# asURL method works on email
pers = self.getPersonModule().newContent(portal_type='Person')
pers.setDefaultEmailText('nobody@example.com')
email = per.getDefaultEmailValue()
self.assertEquals('mailto:nobody@example.com', email.asURL())
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