summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b5b8073)
raw | patch | inline | side by side (parent: b5b8073)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 9 Aug 2010 04:43:50 +0000 (04:43 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 9 Aug 2010 04:43:50 +0000 (04:43 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4513 57a73879-2fb5-44c3-a270-3262357dd7e2
test/db_test_base.py | patch | blob | history | |
test/test_dates.py | patch | blob | history | |
test/test_mailgw.py | patch | blob | history |
diff --git a/test/db_test_base.py b/test/db_test_base.py
index 0751216a46c98df4eae88c2e58bdebf2aa9c75ea..381b21f48a4b43806b4e3051083159b82c9dc2d0 100644 (file)
--- a/test/db_test_base.py
+++ b/test/db_test_base.py
from roundup.hyperdb import String, Password, Link, Multilink, Date, \
Interval, DatabaseError, Boolean, Number, Node
from roundup.mailer import Mailer
-from roundup import date, password, init, instance, configuration, support
+from roundup import date, password, init, instance, configuration, \
+ roundupdb, i18n
from mocknull import MockNull
"""Creates one issue with two attachments, one smaller and one larger
than the set max_attachment_size.
"""
+ old_translate_ = roundupdb._
+ roundupdb._ = i18n.get_translation(language='C').gettext
db = self.db
db.config.NOSY_MAX_ATTACHMENT_SIZE = 4096
res = dict(mail_to = None, mail_msg = None)
self.assert_("File 'test2.txt' not attached" in mail_msg)
self.assert_(base64.encodestring("yyy").rstrip() not in mail_msg)
finally :
+ roundupdb._ = old_translate_
Mailer.smtp_send = backup
class ROTest(MyTestCase):
diff --git a/test/test_dates.py b/test/test_dates.py
index 0dd825121304d76aa0e816d976e090079f298d48..4c315885ef77828aa4b7be4c6f2ca67f18866143 100644 (file)
--- a/test/test_dates.py
+++ b/test/test_dates.py
import datetime
import calendar
+from roundup import date, i18n
from roundup.date import Date, Interval, Range, fixTimeOverflow, \
get_timezone
class DateTestCase(unittest.TestCase):
+ def setUp(self):
+ self.old_gettext_ = i18n.gettext
+ self.old_ngettext_ = i18n.ngettext
+ i18n.gettext = i18n.get_translation(language='C').gettext
+ i18n.ngettext = i18n.get_translation(language='C').ngettext
+
+ def tearDown(self):
+ i18n.gettext = self.old_gettext_
+ i18n.ngettext = self.old_ngettext_
def testDateInterval(self):
ae = self.assertEqual
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index b4a8f95c56514bf4760af55a120660b86370298b..600bc81fdc2c350a5f4fb74c3ac1baa426b261d3 100644 (file)
--- a/test/test_mailgw.py
+++ b/test/test_mailgw.py
os.environ['SENDMAILDEBUG'] = 'mail-test.log'
SENDMAILDEBUG = os.environ['SENDMAILDEBUG']
+from roundup import mailgw, i18n, roundupdb
from roundup.mailgw import MailGW, Unauthorized, uidFromAddress, \
parseContent, IgnoreLoop, IgnoreBulk, MailUsageError, MailUsageHelp
from roundup import init, instance, password, rfc2822, __version__
count = 0
schema = 'classic'
def setUp(self):
+ self.old_translate_ = mailgw._
+ roundupdb._ = mailgw._ = i18n.get_translation(language='C').gettext
MailgwTestCase.count = MailgwTestCase.count + 1
# and open the database / "instance"
address='rgg@test.test', roles='User')
def tearDown(self):
+ roundupdb._ = mailgw._ = self.old_translate_
if os.path.exists(SENDMAILDEBUG):
os.remove(SENDMAILDEBUG)
self.db.close()