def generate_account(self, user): account = Account(key=tools.generate_key()) account.save() user_profile = UserProfile( user=user, account=account ) user_profile.save() send_mail( 'Rmd.io account confirmation', """ Hello, please click this link to activate your rmd.io account: {0}/registration_done/{1} Sincerely, The rmd.io Team """.format( settings.SITE_URL, str(account.key, 'utf-8') ), settings.EMAIL_HOST_USER, [user.email], fail_silently=False, )
def generate_account(self, user): account = Account(key=tools.generate_key()) account.save() user_profile = UserProfile(user=user, account=account) user_profile.save() send_mail( 'Rmd.io account confirmation', """ Hello, please click this link to activate your rmd.io account: http://rmd.io/registration_done/{} Sincerely, The rmd.io Team """.format(account.key), '*****@*****.**', [user.email], fail_silently=False, )
def test_type_of_key_generator_output(): key = tools.generate_key() assert type(key) is str