Commits

Raimon Esteve (Zikzakmedia) committed 1bfe282

pyflakes fixes

  • Participants
  • Parent commits c7d0d13

Comments (0)

Files changed (6)

electronic_mail.py

         """Returns the email body
         """
         result = ''
-        test = defaultdict(unicode).fromkeys(name)
         message = message_from_string(self._get_email(self))
         for part in message.walk():
             content_type = part.get_content_type()
 
 from setuptools import setup
 import re
-import os
 import ConfigParser
 
 config = ConfigParser.ConfigParser()
 "Email Template"
 from __future__ import with_statement
 
-try:
-    from cStringIO import StringIO
-except ImportError:
-    from StringIO import StringIO
 import mimetypes
 import base64
 from email.mime.multipart import MIMEMultipart
         :param records: List Object of the records
         """
         template = self(template_id)
-        Record = Pool().get(template.model.model)
         ElectronicMail = Pool().get('electronic.mail')
         for record in records:
             email_message = self.render(template, record)

tests/__init__.py

 #The COPYRIGHT file at the top level of this repository contains 
 #the full copyright notices and license terms.
 
-from test_template import suite
+from test_electronic_mail_template import suite

tests/test_template.py

-#!/usr/bin/env python
-# -*- coding: UTF-8 -*-
-#This file is part electronic_mail_template module for Tryton.
-#The COPYRIGHT file at the top level of this repository contains 
-#the full copyright notices and license terms.
-"Electronic Mail Template test suite"
-
-import sys, os
-DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
-    '..', '..', '..', '..', '..', 'trytond')))
-if os.path.isdir(DIR):
-    sys.path.insert(0, os.path.dirname(DIR))
-import unittest
-
-import trytond.tests.test_tryton
-from trytond.tests.test_tryton import POOL, test_view, test_depends
-
-
-class TemplateTestCase(unittest.TestCase):
-    """Test Electronic mail templates"""
-
-    def setUp(self):
-        trytond.tests.test_tryton.install_module('electronic_mail_template')
-
-        self.template_obj = POOL.get('electronic_mail.template')
-
-    # def test0010_genshi_test(self):
-        # "Test Genshi templating with a simple expression"
-        # expression = u'<h1>Hello ${record["name"]}</h1>'
-        # record = {'name': u'Cédric'}
-        # result = self.template_obj._engine_genshi(expression, record)
-        # self.assertEqual(result, '<h1>Hello C\xc3\xa9dric</h1>')
-
-    # def test0020view(self):
-        # test_view('electronic_mail_template')
-
-    # def test0030depends(self):
-        # test_depends()
-
-
-def suite():
-    "Electronic mail Template test suite"
-    suite = trytond.tests.test_tryton.suite()
-    suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
-        TemplateTestCase
-        )
-    )
-    return suite
-
-if __name__ == '__main__':
-    unittest.TextTestRunner(verbosity=2).run(suite())
 #The COPYRIGHT file at the top level of this repository contains 
 #the full copyright notices and license terms.
 "Trigger Extension"
-from trytond.model import ModelSQL, ModelView, fields
+from trytond.model import fields
 from trytond.transaction import Transaction
 from trytond.pool import Pool, PoolMeta