equal
deleted
inserted
replaced
11 import pwd |
11 import pwd |
12 |
12 |
13 from logilab.common.testlib import unittest_main |
13 from logilab.common.testlib import unittest_main |
14 from logilab.common.umessage import message_from_string |
14 from logilab.common.umessage import message_from_string |
15 |
15 |
16 from cubicweb.devtools.apptest import EnvBasedTC |
16 from cubicweb.devtools.testlib import CubicWebTC |
17 from cubicweb.common.mail import format_mail |
17 from cubicweb.common.mail import format_mail |
18 |
18 |
19 |
19 |
20 def getlogin(): |
20 def getlogin(): |
21 """avoid usinng os.getlogin() because of strange tty / stdin problems |
21 """avoid usinng os.getlogin() because of strange tty / stdin problems |
23 Another solution would be to use $LOGNAME, $USER or $USERNAME |
23 Another solution would be to use $LOGNAME, $USER or $USERNAME |
24 """ |
24 """ |
25 return pwd.getpwuid(os.getuid())[0] |
25 return pwd.getpwuid(os.getuid())[0] |
26 |
26 |
27 |
27 |
28 class EmailTC(EnvBasedTC): |
28 class EmailTC(CubicWebTC): |
29 |
29 |
30 def test_format_mail(self): |
30 def test_format_mail(self): |
31 self.set_option('sender-addr', 'bim@boum.fr') |
31 self.set_option('sender-addr', 'bim@boum.fr') |
32 self.set_option('sender-name', 'BimBam') |
32 self.set_option('sender-name', 'BimBam') |
33 |
33 |