~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2011-09-21 14:28:02 UTC
  • mfrom: (14006 devel)
  • mto: This revision was merged to the branch mainline in revision 14010.
  • Revision ID: jelmer@canonical.com-20110921142802-7ggkc204igsy532w
MergeĀ lp:launchpad

Show diffs side-by-side

added added

removed removed

Lines of Context:
505
505
    for any other required objects.
506
506
    """
507
507
 
508
 
    def loginAsAnyone(self):
 
508
    def loginAsAnyone(self, participation=None):
509
509
        """Log in as an arbitrary person.
510
510
 
511
511
        If you want to log in as a celebrity, including admins, see
513
513
        """
514
514
        login(ANONYMOUS)
515
515
        person = self.makePerson()
516
 
        login_as(person)
 
516
        login_as(person, participation)
517
517
        return person
518
518
 
519
519
    @with_celebrity_logged_in('admin')
1627
1627
        return branch.createBranchRevision(sequence, revision)
1628
1628
 
1629
1629
    def makeBug(self, product=None, owner=None, bug_watch_url=None,
1630
 
                private=False, security_related=False, date_closed=None,
1631
 
                title=None, date_created=None, description=None, comment=None,
 
1630
                private=False, date_closed=None, title=None,
 
1631
                date_created=None, description=None, comment=None,
1632
1632
                status=None, distribution=None, milestone=None, series=None,
1633
1633
                tags=None, sourcepackagename=None):
1634
1634
        """Create and return a new, arbitrary Bug.
1679
1679
                sourcepackagename=sourcepackagename)
1680
1680
        create_bug_params = CreateBugParams(
1681
1681
            owner, title, comment=comment, private=private,
1682
 
            security_related=security_related,
1683
1682
            datecreated=date_created, description=description,
1684
1683
            status=status, tags=tags)
1685
1684
        create_bug_params.setBugTarget(
2953
2952
    def makePOTemplate(self, productseries=None, distroseries=None,
2954
2953
                       sourcepackagename=None, owner=None, name=None,
2955
2954
                       translation_domain=None, path=None,
2956
 
                       copy_pofiles=True, side=None, sourcepackage=None):
 
2955
                       copy_pofiles=True, side=None, sourcepackage=None,
 
2956
                       iscurrent=True):
2957
2957
        """Make a new translation template."""
2958
2958
        if sourcepackage is not None:
2959
2959
            assert distroseries is None, (
2994
2994
        if path is None:
2995
2995
            path = 'messages.pot'
2996
2996
 
2997
 
        return subset.new(name, translation_domain, path, owner, copy_pofiles)
 
2997
        pot = subset.new(name, translation_domain, path, owner, copy_pofiles)
 
2998
        removeSecurityProxy(pot).iscurrent = iscurrent
 
2999
        return pot
2998
3000
 
2999
3001
    def makePOTemplateAndPOFiles(self, language_codes, **kwargs):
3000
3002
        """Create a POTemplate and associated POFiles.