def setUp(self): self.sample_user = RegistrationProfile.create_inactive_user( username='******', password='******', email='*****@*****.**') self.expired_user = RegistrationProfile.create_inactive_user( username='******', password='******', email='*****@*****.**') self.expired_user.date_joined -= datetime.timedelta( days=settings.ACCOUNT_ACTIVATION_DAYS + 1) self.expired_user.save()
def setUp(self): self.sample_user = RegistrationProfile.create_inactive_user( username="******", password="******", email="*****@*****.**" ) self.expired_user = RegistrationProfile.create_inactive_user( username="******", password="******", email="*****@*****.**" ) self.expired_user.date_joined -= datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS + 1) self.expired_user.save()
def save(self): """ Create the new ``User`` and ``RegistrationProfile``, and #returns the ``User``. This is essentially a light wrapper around ``RegistrationProfile.objects.create_inactive_user()``, feeding it the form data and a profile callback (see the documentation on ``create_inactive_user()`` for details) if supplied. """ new_user = RegistrationProfile.create_inactive_user( username=self.cleaned_data['username'], password=self.cleaned_data['password1'], email=self.cleaned_data['email'], #profile_callback=profile_callback, send_email = False) new_user.is_active = True new_user.activation_key = u"ALREADY_ACTIVATED" new_user.save() #RegistrationProfile.activate_user(new_user.activation_key) #new_user = RegistrationProfile.create_inactive_user( # username=self.cleaned_data['username'], # password=self.cleaned_data['password1'], # email=self.cleaned_data['email']) return new_user
def save(self): """ Create the new ``User`` and ``RegistrationProfile``, and returns the ``User``. This is essentially a light wrapper around ``RegistrationProfile.objects.create_inactive_user()``, feeding it the form data and a profile callback (see the documentation on ``create_inactive_user()`` for details) if supplied. """ new_user = RegistrationProfile.create_inactive_user( username=self.cleaned_data['username'], password=self.cleaned_data['password1'], email=self.cleaned_data['email']) return new_user
def save(self): """ Create the new ``User`` and ``RegistrationProfile``, and returns the ``User``. This is essentially a light wrapper around ``RegistrationProfile.objects.create_inactive_user()``, feeding it the form data and a profile callback (see the documentation on ``create_inactive_user()`` for details) if supplied. """ new_user = RegistrationProfile.create_inactive_user( username=self.cleaned_data['username'], password=self.cleaned_data['password1'], email=self.cleaned_data['email']) return new_user