~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/testing/factory.py

[r=benji][bug=795573,
 796233] On DistroSeries:+localpackagediffs ensure that the comment
 form is hidden after adding a new comment to a DistroSeriesDifference,
 prevent empty comments from being submitted,
 and add some animations and effects to make the UI less jarring and easier to
 follow.

Show diffs side-by-side

added added

removed removed

Lines of Context:
595
595
        self, email=None, name=None, password=None,
596
596
        email_address_status=None, hide_email_addresses=False,
597
597
        displayname=None, time_zone=None, latitude=None, longitude=None,
598
 
        selfgenerated_bugnotifications=False):
 
598
        selfgenerated_bugnotifications=False, member_of=()):
599
599
        """Create and return a new, arbitrary Person.
600
600
 
601
601
        :param email: The email address for the new person.
660
660
 
661
661
        self.makeOpenIdIdentifier(person.account)
662
662
 
 
663
        for team in member_of:
 
664
            with person_logged_in(team.teamowner):
 
665
                team.addMember(person, team.teamowner)
 
666
 
663
667
        # Ensure updated ValidPersonCache
664
668
        flush_database_updates()
665
669
        return person
1401
1405
        # here.
1402
1406
        removeSecurityProxy(branch).branchChanged(
1403
1407
            '', 'rev1', None, None, None)
1404
 
        ubuntu_branches = getUtility(ILaunchpadCelebrities).ubuntu_branches
1405
 
        run_with_login(
1406
 
            ubuntu_branches.teamowner,
1407
 
            package.development_version.setBranch,
1408
 
            PackagePublishingPocket.RELEASE,
1409
 
            branch,
1410
 
            ubuntu_branches.teamowner)
 
1408
        with person_logged_in(package.distribution.owner):
 
1409
            package.development_version.setBranch(
 
1410
                PackagePublishingPocket.RELEASE, branch,
 
1411
                package.distribution.owner)
1411
1412
        return branch
1412
1413
 
1413
1414
    def makeBranchMergeProposal(self, target_branch=None, registrant=None,
3375
3376
        if pocket is None:
3376
3377
            pocket = PackagePublishingPocket.RELEASE
3377
3378
        package_upload = distroseries.createQueueEntry(
3378
 
            pocket, changes_filename, changes_file_content, archive,
 
3379
            pocket, archive, changes_filename, changes_file_content,
3379
3380
            signing_key=signing_key, package_copy_job=package_copy_job)
3380
3381
        if status is not None:
3381
3382
            naked_package_upload = removeSecurityProxy(package_upload)