~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/testing/layers.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-10-05 11:55:37 UTC
  • mfrom: (14090.2.4 longpoll-408-errors)
  • Revision ID: launchpad@pqm.canonical.com-20111005115537-u5ir9xz5s3g45sy2
[r=allenap][no-qa] Swallow 408 errors in the LongPoll javascript
        library.

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
    )
96
96
from zope.component.interfaces import ComponentLookupError
97
97
import zope.publisher.publish
98
 
from zope.security.management import (
99
 
    endInteraction,
100
 
    getSecurityPolicy,
101
 
    )
 
98
from zope.security.management import getSecurityPolicy
102
99
from zope.security.simplepolicies import PermissiveSecurityPolicy
103
100
from zope.server.logger.pythonlogger import PythonLogger
104
101
 
148
145
from lp.services.rabbit.server import RabbitServer
149
146
from lp.testing import (
150
147
    ANONYMOUS,
 
148
    is_logged_in,
151
149
    login,
152
150
    logout,
153
151
    )
1357
1355
    def testTearDown(cls):
1358
1356
        getUtility(IOpenLaunchBag).clear()
1359
1357
 
1360
 
        endInteraction()
 
1358
        # If tests forget to logout, we can do it for them.
 
1359
        if is_logged_in():
 
1360
            logout()
1361
1361
 
1362
1362
        # Disconnect Storm so it doesn't get in the way of database resets
1363
1363
        disconnect_stores()
1386
1386
    def testTearDown(cls):
1387
1387
        getUtility(IOpenLaunchBag).clear()
1388
1388
 
1389
 
        endInteraction()
 
1389
        # If tests forget to logout, we can do it for them.
 
1390
        if is_logged_in():
 
1391
            logout()
1390
1392
 
1391
1393
        # Reset any statistics
1392
1394
        from canonical.launchpad.webapp.opstats import OpStats