~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Julian Edwards
  • Date: 2010-08-26 08:02:08 UTC
  • mfrom: (11447 launchpad)
  • mto: This revision was merged to the branch mainline in revision 11453.
  • Revision ID: julian.edwards@canonical.com-20100826080208-sut7s35g9z0qtk9v
merge devel

Show diffs side-by-side

added added

removed removed

Lines of Context:
439
439
        registry_team.addMember(user, registry_team.teamowner)
440
440
        return user
441
441
 
442
 
 
443
442
    def makeCopyArchiveLocation(self, distribution=None, owner=None,
444
443
        name=None, enabled=True):
445
444
        """Create and return a new arbitrary location for copy packages."""
1495
1494
        mail.parsed_string = mail.as_string()
1496
1495
        return mail
1497
1496
 
1498
 
    def makeSpecification(self, product=None, title=None, distribution=None):
 
1497
    def makeSpecification(self, product=None, title=None, distribution=None,
 
1498
                          name=None, summary=None,
 
1499
                          status=SpecificationDefinitionStatus.NEW):
1499
1500
        """Create and return a new, arbitrary Blueprint.
1500
1501
 
1501
1502
        :param product: The product to make the blueprint on.  If one is
1503
1504
        """
1504
1505
        if distribution is None and product is None:
1505
1506
            product = self.makeProduct()
 
1507
        if name is None:
 
1508
            name = self.getUniqueString('name')
 
1509
        if summary is None:
 
1510
            summary = self.getUniqueString('summary')
1506
1511
        if title is None:
1507
1512
            title = self.getUniqueString('title')
1508
1513
        return getUtility(ISpecificationSet).new(
1509
 
            name=self.getUniqueString('name'),
 
1514
            name=name,
1510
1515
            title=title,
1511
1516
            specurl=None,
1512
 
            summary=self.getUniqueString('summary'),
1513
 
            definition_status=SpecificationDefinitionStatus.NEW,
 
1517
            summary=summary,
 
1518
            definition_status=status,
1514
1519
            owner=self.makePerson(),
1515
1520
            product=product,
1516
1521
            distribution=distribution)