def create_heroku(cls, heroku_id, plan = "basic"): # generates a "random" password for the heroku based user # to be created in the data source password = quorum.generate_identifier() # creates a new account instance and populates it with the # proper heroku account values, note that some values are # set as mock values (eg: email) for validation pass account = cls.new() account.username = heroku_id account.password = password account.password_confirm = password account.email = heroku_id account.email_confirm = heroku_id account.plan = plan account.save() # sets the account as enabled (automatic enable) and the re-saves # it so that it becomes enabled by default account.enabled = True account.save() # returns the account instance that has just been created to the # caller method return account
def test_generate_identifier(self): identifier = quorum.generate_identifier( size = 16, chars = string.ascii_uppercase ) self.assertEqual(len(identifier), 16) for char in identifier: self.assertTrue(char in string.ascii_uppercase)
def test_generate_identifier(self): identifier = quorum.generate_identifier(size=16, chars=string.ascii_uppercase) self.assertEqual(len(identifier), 16) for char in identifier: self.assertTrue(char in string.ascii_uppercase)