~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/browser/tests/test_branchmergequeue.py

Got a working test

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
from canonical.launchpad.testing.pages import (
11
11
    extract_text,
12
12
    find_main_content,
13
 
    find_tags_by_class,
14
13
    )
15
14
from canonical.launchpad.webapp import canonical_url
16
15
from canonical.testing.layers import (
17
16
    DatabaseFunctionalLayer,
18
 
    LaunchpadFunctionalLayer,
19
17
    )
20
18
from lp.testing import (
21
19
    ANONYMOUS,
33
31
        """Test the index page of a branch merge queue."""
34
32
        with person_logged_in(ANONYMOUS):
35
33
            queue = self.factory.makeBranchMergeQueue()
 
34
            queue_owner = queue.owner.displayname
 
35
            queue_registrant = queue.registrant.displayname
 
36
            queue_description = queue.description
36
37
            queue_url = canonical_url(queue)
37
38
 
 
39
            branch = self.factory.makeBranch()
 
40
            branch_name = branch.bzr_identity
 
41
            with person_logged_in(branch.owner):
 
42
                branch.addToQueue(queue)
 
43
 
38
44
        browser = self.getUserBrowser(canonical_url(queue), user=queue.owner)
39
45
 
40
46
 
48
54
            Description
49
55
            %(queue_description)s
50
56
 
51
 
            The following branches are managed by this queue:""" % {
 
57
            The following branches are managed by this queue:
 
58
            %(branch_name)s""" % {
52
59
                'queue_name': queue.name,
53
 
                'owner_name': queue.owner.displayname,
54
 
                'registrant_name': queue.registrant.displayname,
55
 
                'queue_description': queue.description,
 
60
                'owner_name': queue_owner,
 
61
                'registrant_name': queue_registrant,
 
62
                'queue_description': queue_description,
 
63
                'branch_name': branch_name,
56
64
                }
57
65
 
58
66
        main_text = extract_text(find_main_content(browser.contents))