Switch to unified view

a/AlluraTesting/alluratest/controller.py b/AlluraTesting/alluratest/controller.py
...
...
7
pylons.g = pylons.app_globals
7
pylons.g = pylons.app_globals
8
import mock
8
import mock
9
import beaker.session
9
import beaker.session
10
from formencode import variabledecode
10
from formencode import variabledecode
11
from paste.deploy import loadapp
11
from paste.deploy import loadapp
12
from paste.deploy.converters import asbool
12
from paste.script.appinstall import SetupCommand
13
from paste.script.appinstall import SetupCommand
13
from pylons import c, g, url, request, response, session
14
from pylons import c, g, url, request, response, session
14
import tg
15
import tg
15
from webtest import TestApp
16
from webtest import TestApp
16
from webob import Request, Response
17
from webob import Request, Response
...
...
95
    def setUp(self):
96
    def setUp(self):
96
        """Method called by nose before running each test"""
97
        """Method called by nose before running each test"""
97
        self.app = ValidatingTestApp(setup_functional_test(app_name=self.application_under_test))
98
        self.app = ValidatingTestApp(setup_functional_test(app_name=self.application_under_test))
98
        if self.validate_skip:
99
        if self.validate_skip:
99
            self.app.validate_skip = self.validate_skip
100
            self.app.validate_skip = self.validate_skip
101
        if asbool(tg.config.get('smtp.mock')):
102
            self.smtp_mock = mock.patch('allura.lib.mail_util.smtplib.SMTP')
103
            self.smtp_mock.start()
100
104
101
    def tearDown(self):
105
    def tearDown(self):
102
        """Method called by nose after running each test"""
106
        """Method called by nose after running each test"""
103
        pass
107
        if asbool(tg.config.get('smtp.mock')):
108
            self.smtp_mock.stop()
104
109
105
    def webflash(self, response):
110
    def webflash(self, response):
106
        "Extract webflash content from response."
111
        "Extract webflash content from response."
107
        return urllib.unquote(response.cookies_set.get('webflash', ''))
112
        return urllib.unquote(response.cookies_set.get('webflash', ''))
108
113