66
from textwrap import dedent
67
from cProfile import Profile
68
from textwrap import dedent
69
from unittest import TestCase, TestResult
69
from unittest import (
70
73
from urllib import urlopen
72
75
from fixtures import (
79
from lazr.restful.utils import safe_hasattr
77
81
from storm.zope.interfaces import IZStorm
83
from windmill.bin.admin_lib import (
85
teardown as windmill_teardown,
79
87
import wsgi_intercept
80
88
from wsgi_intercept import httplib2_intercept
82
from lazr.restful.utils import safe_hasattr
84
from windmill.bin.admin_lib import (
85
start_windmill, teardown as windmill_teardown)
89
from zope.app.publication.httpfactory import chooseClasses
87
90
import zope.app.testing.functional
91
from zope.app.testing.functional import (
95
from zope.component import (
100
from zope.component.interfaces import ComponentLookupError
88
101
import zope.publisher.publish
89
from zope.app.publication.httpfactory import chooseClasses
90
from zope.app.testing.functional import FunctionalTestSetup, ZopePublication
91
from zope.component import getUtility, provideUtility
92
from zope.component import globalregistry
93
from zope.component.interfaces import ComponentLookupError
94
102
from zope.security.management import getSecurityPolicy
95
103
from zope.security.simplepolicies import PermissiveSecurityPolicy
96
104
from zope.server.logger.pythonlogger import PythonLogger
97
105
from zope.testing.testrunner.runner import FakeInputContinueGenerator
99
import canonical.launchpad.webapp.session
100
from canonical.launchpad.webapp.vhosts import allvhosts
101
from canonical.lazr import pidfile
102
from canonical.config import CanonicalConfig, config, dbconfig
107
from canonical.config import (
103
112
from canonical.config.fixture import (
105
114
ConfigUseFixture,
107
116
from canonical.database.revision import (
108
confirm_dbrevision, confirm_dbrevision_on_startup)
118
confirm_dbrevision_on_startup,
109
120
from canonical.database.sqlbase import (
112
123
ZopelessTransactionManager,
114
125
from canonical.launchpad.interfaces.mailbox import IMailBox
115
from canonical.launchpad.webapp.interfaces import IOpenLaunchBag
116
from lp.testing import ANONYMOUS, login, logout, is_logged_in
117
import lp.services.mail.stub
118
from lp.services.mail.mailbox import TestMailBox
119
126
from canonical.launchpad.scripts import execute_zcml_for_scripts
120
from lp.services.googlesearch.tests.googleserviceharness import (
121
GoogleServiceTestSetup)
122
127
from canonical.launchpad.webapp.interfaces import (
123
DEFAULT_FLAVOR, IStoreSelector, MAIN_STORE)
124
133
from canonical.launchpad.webapp.servers import (
125
LaunchpadAccessLogger, register_launchpad_request_publication_factories)
134
LaunchpadAccessLogger,
135
register_launchpad_request_publication_factories,
137
import canonical.launchpad.webapp.session
138
from canonical.launchpad.webapp.vhosts import allvhosts
139
from canonical.lazr import pidfile
126
140
from canonical.lazr.testing.layers import MockRootFolder
127
141
from canonical.lazr.timeout import (
128
get_default_timeout_function, set_default_timeout_function)
142
get_default_timeout_function,
143
set_default_timeout_function,
145
from canonical.librarian.testing.server import LibrarianServerFixture
129
146
from canonical.lp import initZopeless
130
from canonical.librarian.testing.server import LibrarianServerFixture
131
147
from canonical.testing import reset_logging
132
148
from canonical.testing.profiled import profiled
133
149
from canonical.testing.smtpd import SMTPController
150
from lp.services.googlesearch.tests.googleserviceharness import (
151
GoogleServiceTestSetup,
153
from lp.services.mail.mailbox import TestMailBox
154
import lp.services.mail.stub
134
155
from lp.services.memcache.client import memcache_client_factory
135
156
from lp.services.osutils import kill_by_pidfile
157
from lp.services.rabbit.testing.server import RabbitServer
158
from lp.testing import (
136
164
from lp.testing.pgsql import PgTestSetup