Ejemplo n.º 1
0
 def extract_email_addresses(self, data):
     ret = [
         get_email_address_model()(email=data['email'],
                                   verified=True,
                                   primary=True)
     ]
     return ret
Ejemplo n.º 2
0
 def extract_email_addresses(self, data):
     ret = []
     email = data.get('email')
     if email and data.get('email_verified'):
         ret.append(get_email_address_model()(email=email,
                                              verified=True,
                                              primary=True))
     return ret
Ejemplo n.º 3
0
 def extract_email_addresses(self, data):
     ret = [
         get_email_address_model()(
             email=data['response']['user']['settings']['email_address'],
             verified=True,
             primary=True)
     ]
     return ret
Ejemplo n.º 4
0
    def extract_email_addresses(self, data):
        addresses = []
        for email in data.get("emails", []):
            addresses.append(get_email_address_model()(
                email=email.get("email"),
                verified=email.get("verfified"),
                primary=email.get("primary")))

        return addresses
Ejemplo n.º 5
0
 def extract_email_addresses(self, data):
     ret = []
     email = data.get('email')
     if email:
         # data['verified'] does not imply the email address is
         # verified.
         ret.append(get_email_address_model()(email=email,
                                              verified=False,
                                              primary=True))
     return ret
Ejemplo n.º 6
0
    def extract_email_addresses(self, data):
        ret = []
        data = data['kakao_account']
        email = data.get('email')

        if email:
            verified = data.get('is_email_verified')
            # data['is_email_verified'] imply the email address is
            # verified
            ret.append(get_email_address_model()(email=email,
                                                 verified=verified,
                                                 primary=True))
        return ret
Ejemplo n.º 7
0
from django.test.client import RequestFactory
from django.test.utils import override_settings
from django.urls import reverse

from allauth.account import app_settings as account_settings
from allauth.account.utils import get_email_address_model
from allauth.socialaccount import providers
from allauth.socialaccount.models import SocialAccount
from allauth.socialaccount.tests import OAuth2TestsMixin
from allauth.tests import MockedResponse, TestCase, patch
from allauth.utils import get_user_model

from .provider import FacebookProvider

EmailAddress = get_email_address_model()

@override_settings(
    SOCIALACCOUNT_AUTO_SIGNUP=True,
    ACCOUNT_SIGNUP_FORM_CLASS=None,
    LOGIN_REDIRECT_URL='/accounts/profile/',
    ACCOUNT_EMAIL_VERIFICATION=account_settings
    .EmailVerificationMethod.NONE,
    SOCIALACCOUNT_PROVIDERS={
        'facebook': {
            'AUTH_PARAMS': {},
            'VERIFIED_EMAIL': False}})
class FacebookTests(OAuth2TestsMixin, TestCase):
    provider_id = FacebookProvider.id

    facebook_data = """
Ejemplo n.º 8
0
 def extract_email_addresses(self, data):
     # a salesforce user must have an email, but it might not be verified
     email = get_email_address_model()(email=data.get('email'),
                                       primary=True,
                                       verified=data.get('email_verified'))
     return [email]