def send_confirmation_email(cls, user, new_email=None): """Process the email confirmation sending.""" pending_info = { 'user': user, 'category': ActionCategory.CONFIRM_EMAIL, 'token': get_uuid(cls.DEFAULT_TOKEN_LENGHT), } if new_email: serializer = EmailSerializer(data={'email': new_email}) serializer.is_valid(raise_exception=True) pending_info['extra'] = serializer.validated_data pending_action, _ = PendingAction.objects.get_or_create( user=user, category=ActionCategory.CONFIRM_EMAIL, defaults=pending_info, ) AuthEmailService.send_confirm_email(pending_action)
def test_get_uuid_pass_limit(): test_hash = get_uuid(limit=100) assert isinstance(test_hash, str)
def test_get_uuid(): test_hash = get_uuid() assert isinstance(test_hash, str)