~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: j.c.sackett
  • Date: 2011-05-06 14:21:06 UTC
  • mto: (12929.9.1 apocalyptic-messages-0)
  • mto: This revision was merged to the branch mainline in revision 13004.
  • Revision ID: jonathan.sackett@canonical.com-20110506142106-cuojp079vkzaztmc
makeAdministrator now randomly generates data if provided None in args.

Show diffs side-by-side

added added

removed removed

Lines of Context:
486
486
        login_as(person)
487
487
        return person
488
488
 
489
 
    def makeAdministrator(self, name=None, email='new_admin@example.com',
490
 
                          password='test'):
 
489
    def makeAdministrator(self, name=None, email=None, password=None):
491
490
        from lp.testing.sampledata import ADMIN_EMAIL
 
491
        if name = None:
 
492
            name = self.getUniqueString()
 
493
        if email = None:
 
494
            email = '%s@%s.com' % (
 
495
                self.getUniqueString(), self.getUniqueString())
 
496
        if password = None:
 
497
            password = self.getUniqueString()
492
498
        login(ADMIN_EMAIL)
493
499
        user = self.makePerson(name=name,
494
500
                               email=email,