~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/tests/test_peoplemerge.py

  • Committer: j.c.sackett
  • Date: 2011-01-06 17:48:49 UTC
  • mto: This revision was merged to the branch mainline in revision 12195.
  • Revision ID: jonathan.sackett@canonical.com-20110106174849-1k9aq4x41tizgiwq
Added ppa validation step to RequestPeopleMergeView

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    )
31
31
 
32
32
 
 
33
class TestRequestPeopleMergeView(TestCaseWithFactory):
 
34
 
 
35
    layer = DatabaseFunctionalLayer
 
36
 
 
37
    def setUp(self):
 
38
        super(TestRequestPeopleMergeView, self).setUp()
 
39
        self.person_set = getUtility(IPersonSet)
 
40
        self.dupe = self.factory.makePerson(name='dupe')
 
41
        self.target = self.factory.makeTeam(name='target-team')
 
42
 
 
43
    def test_cannot_merge_person_with_ppas(self):
 
44
        # A team with a PPA cannot be merged.
 
45
        login_celebrity('admin')
 
46
        archive = self.dupe.createPPA()
 
47
        login_celebrity('registry_experts')
 
48
        form = {
 
49
            'field.dupe_person': self.dupe.name,
 
50
            'field.target_person': self.target.name,
 
51
            'field.actions.continue': 'Continue',
 
52
            }
 
53
        return create_initialized_view(
 
54
            self.person_set, '+requestmerge', form=form)
 
55
        self.assertEqual(
 
56
            [u"dupe-team has a PPA that must be deleted before it can be "
 
57
              "merged. It may take ten minutes to remove the deleted PPA's "
 
58
              "files."],
 
59
            view.errors)
 
60
 
 
61
 
33
62
class TestRequestPeopleMergeMultipleEmailsView(TestCaseWithFactory):
34
63
    """Test the RequestPeopleMergeMultipleEmailsView rules."""
35
64