~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/scripts/tests/test_checkwatches.py

  • Committer: Gavin Panella
  • Date: 2010-03-22 13:24:49 UTC
  • mto: (7675.581.88 launchpad)
  • mto: This revision was merged to the branch mainline in revision 10607.
  • Revision ID: gavin.panella@canonical.com-20100322132449-7xio2ods79b2l945
Go back to ISOLATION_LEVEL_SERIALIZABLE in checkwatches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
from zope.component import getUtility
15
15
 
16
16
from canonical.config import config
17
 
from canonical.database.sqlbase import ISOLATION_LEVEL_AUTOCOMMIT, commit
 
17
from canonical.database.sqlbase import commit
18
18
from canonical.launchpad.ftests import login
19
19
from canonical.launchpad.interfaces import (
20
20
    BugTaskStatus, BugTrackerType, IBugSet, IBugTaskSet,
37
37
    return BugzillaAPI(bugtracker.baseurl)
38
38
 
39
39
 
40
 
class CheckwatchesTestCase(TestCaseWithFactory):
41
 
    """LaunchpadZopelessLayer with auto-commit."""
42
 
 
43
 
    layer = LaunchpadZopelessLayer
44
 
 
45
 
    def setUp(self):
46
 
        super(CheckwatchesTestCase, self).setUp()
47
 
        self.layer.alterConnection(
48
 
            isolation=ISOLATION_LEVEL_AUTOCOMMIT)
49
 
 
50
 
 
51
40
class NonConnectingBugzillaAPI(BugzillaAPI):
52
41
    """A non-connected version of the BugzillaAPI ExternalBugTracker."""
53
42
 
74
63
        return []
75
64
 
76
65
 
77
 
class TestCheckwatchesWithSyncableGnomeProducts(CheckwatchesTestCase):
 
66
class TestCheckwatchesWithSyncableGnomeProducts(TestCaseWithFactory):
 
67
 
 
68
    layer = LaunchpadZopelessLayer
78
69
 
79
70
    def setUp(self):
80
71
        super(TestCheckwatchesWithSyncableGnomeProducts, self).setUp()
112
103
            gnome_bugzilla, [bug_watch_1, bug_watch_2])
113
104
 
114
105
 
115
 
class TestBugWatchUpdater(CheckwatchesTestCase):
 
106
class TestBugWatchUpdater(TestCaseWithFactory):
 
107
 
 
108
    layer = LaunchpadZopelessLayer
116
109
 
117
110
    def test_bug_497141(self):
118
111
        # Regression test for bug 497141. KeyErrors raised in
328
321
 
329
322
 
330
323
class TestTwistedThreadSchedulerInPlace(
331
 
    ZopeTestInSubProcess, CheckwatchesTestCase):
 
324
    ZopeTestInSubProcess, TestCaseWithFactory):
332
325
    """Test TwistedThreadScheduler in place.
333
326
 
334
327
    As in, driving as much of the bug watch machinery as is possible
335
328
    without making external connections.
336
329
    """
337
330
 
 
331
    layer = LaunchpadZopelessLayer
 
332
 
338
333
    def test(self):
339
334
        # Prepare test data.
340
335
        self.owner = self.factory.makePerson()