~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/tests/peoplemerge-views.txt

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-07-30 09:17:36 UTC
  • mfrom: (13555.6.2 bug-761874)
  • Revision ID: launchpad@pqm.canonical.com-20110730091736-jjqwebomgxusdl3u
[r=wallyworld][bug=761874] Stop mailing ~registry on team deletes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
    >>> from lp.app.interfaces.launchpad import ILaunchpadCelebrities
13
13
    >>> from lp.registry.interfaces.person import IPersonSet
 
14
    >>> from lp.registry.interfaces.persontransferjob import (
 
15
    ...     IPersonMergeJobSource,
 
16
    ...     )
14
17
    >>> registry_experts = getUtility(ILaunchpadCelebrities).registry_experts
15
18
    >>> person_set = getUtility(IPersonSet)
 
19
    >>> merge_job_source = getUtility(IPersonMergeJobSource)
16
20
    >>> registry_expert= factory.makeRegistryExpert()
17
21
    >>> login_person(registry_expert)
18
22
 
128
132
    >>> print view.cancel_url
129
133
    http://launchpad.dev/~deletable
130
134
 
131
 
The view uses the same form fields as the team merge view, but it does not
 
135
The view uses the similar form fields as the team merge view, but it does not
132
136
render them because their values are preset. Only the action is rendered,
133
137
and it is only rendered if canDelete() returns True.
134
138
 
137
141
    >>> view = create_initialized_view(
138
142
    ...     deletable_team, '+delete', principal=team_owner)
139
143
    >>> view.field_names
140
 
    ['dupe_person', 'target_person']
 
144
    ['dupe_person']
141
145
 
142
146
    >>> view.default_values
143
 
    {'field.target_person': u'registry', 'field.dupe_person': u'deletable'}
 
147
    {'field.delete': True, 'field.dupe_person': u'deletable'}
144
148
 
145
149
    >>> content = find_tag_by_id(view.render(), 'maincontent')
146
150
    >>> print find_tag_by_id(content, 'field.dupe_person')
147
151
    None
148
152
 
149
 
    >>> print find_tag_by_id(content, 'field.target_person')
 
153
    >>> print find_tag_by_id(content, 'field.delete')
150
154
    None
151
155
 
152
156
    >>> print find_tag_by_id(content, 'field.actions.delete')['value']
179
183
    >>> print view.next_url
180
184
    http://launchpad.dev/people
181
185
 
 
186
And there is a person merge job setup to delete them.
 
187
 
 
188
    >>> job = merge_job_source.find(deletable_team).any()
 
189
    >>> job.metadata['delete']
 
190
    True
 
191
    >>> job.from_person.name
 
192
    u'deletable'
 
193
 
182
194
The delete team view cannot be hacked to delete another team, or change
183
195
the team that the merge operation is performed with.
184
196