~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/model/tests/test_bug.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-07-29 14:07:49 UTC
  • mfrom: (13543.5.1 mark-dup-empty)
  • Revision ID: launchpad@pqm.canonical.com-20110729140749-4lp16wmxmae01je4
[r=jcsackett][bug=811262] No AttributeError marking a bug as not a
 dupe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
__metaclass__ = type
5
5
 
 
6
from testtools.testcase import ExpectedException
 
7
 
6
8
from canonical.testing.layers import DatabaseFunctionalLayer
7
9
from lp.bugs.enum import BugNotificationLevel
8
10
from lp.bugs.interfaces.bugtask import BugTaskStatus
21
23
 
22
24
    layer = DatabaseFunctionalLayer
23
25
 
 
26
    def test_markAsDuplicate_None(self):
 
27
        # Calling markAsDuplicate(None) on a bug that is not currently a
 
28
        # duplicate works correctly, and does not raise an AttributeError.
 
29
        bug = self.factory.makeBug()
 
30
        with ExpectedException(AssertionError, 'AttributeError not raised'):
 
31
            with ExpectedException(AttributeError, ''):
 
32
                with person_logged_in(self.factory.makePerson()):
 
33
                    bug.markAsDuplicate(None)
 
34
 
24
35
    def test_get_subscribers_for_person_unsubscribed(self):
25
36
        bug = self.factory.makeBug()
26
37
        person = self.factory.makePerson()