Did I find the right examples for you? yes no

All Samples(14)  |  Call(14)  |  Derive(0)  |  Import(0)

src/e/r/erp5-HEAD/product/MailTemplates/tests/test_MailTemplate.py   erp5(Download)
    def test_addNoREQUEST(self):
        self._add('test_mt','MailHost')        
        # check settings
        self.assertEqual(self.app.test_mt.expand,0)
        self.assertEqual(self.app.test_mt.mailhost,'MailHost')
    def test_addNoMailHostSelected(self):
        self._add('test_mt',REQUEST=self.r)        
        # check settings
        self.assertEqual(self.app.test_mt.expand,0)
        self.assertEqual(self.app.test_mt.mailhost,None)
    def test_add(self,body = None):
        text = open(os.path.join(test_folder,'..','www','default.txt')).read()
        if body is not None:
            text = text[:-12] + body + text[-11:]
            self._add('test_mt','MailHost',text=text,REQUEST=self.r)
        else:
            self._add('test_mt','MailHost',REQUEST=self.r)
    def test_addFile(self):
        self.r.form['file'] = self.makeFileUpload()
        self._add('test_mt','MailHost',REQUEST=self.r)
        # check settings
        self.assertEqual(self.app.test_mt.expand,0)

src/p/r/Products.MailTemplates-2.0.0/Products/MailTemplates/tests/test_MailTemplate.py   Products.MailTemplates(Download)
    def test_addNoREQUEST(self):
        self._add('test_mt','MailHost')        
        # check settings
        self.assertEqual(self.app.test_mt.expand,0)
        self.assertEqual(self.app.test_mt.mailhost,'MailHost')
    def test_addNoMailHostSelected(self):
        self._add('test_mt',REQUEST=self.r)        
        # check settings
        self.assertEqual(self.app.test_mt.expand,0)
        self.assertEqual(self.app.test_mt.mailhost,None)
    def test_add(self,body = None):
        text = open(os.path.join(test_folder,'..','www','default.txt')).read()
        if body is not None:
            text = text[:-13] + body + text[-13:]
            self._add('test_mt','MailHost',text=text,REQUEST=self.r)
        else:
            self._add('test_mt','MailHost',REQUEST=self.r)
    def test_addFile(self):
        self.r.form['file'] = self.makeFileUpload()
        self._add('test_mt','MailHost',REQUEST=self.r)
        # check settings
        self.assertEqual(self.app.test_mt.expand,0)