Exemplo n.º 1
0
 def test_no_subscribe(self, upsert_mock, fxa_info_mock):
     data = {
         'email': '*****@*****.**',
         'uid': 'the-fxa-id',
         'locale': 'en-US,en',
         'marketingOptIn': False,
     }
     fxa_verified(data)
     upsert_mock.delay.assert_not_called()
     fxa_info_mock.assert_called_with(data['email'], 'en-US', data['uid'])
Exemplo n.º 2
0
 def test_no_subscribe(self, upsert_mock, fxa_info_mock):
     data = {
         'email': '*****@*****.**',
         'uid': 'the-fxa-id',
         'locale': 'en-US,en',
         'marketingOptIn': False,
     }
     fxa_verified(data)
     upsert_mock.delay.assert_not_called()
     fxa_info_mock.assert_called_with(data['email'], 'en-US', data['uid'], '', None)
Exemplo n.º 3
0
 def test_with_createDate(self, upsert_mock, fxa_info_mock):
     create_date_float = 1526996035.498
     create_date = datetime.fromtimestamp(create_date_float)
     data = {
         'createDate': create_date_float,
         'email': '*****@*****.**',
         'uid': 'the-fxa-id',
         'locale': 'en-US,en'
     }
     fxa_verified(data)
     fxa_info_mock.assert_called_with(data['email'], 'en-US', data['uid'], '', create_date)
Exemplo n.º 4
0
 def test_with_subscribe(self, upsert_mock, fxa_info_mock):
     data = {
         'email': '*****@*****.**',
         'uid': 'the-fxa-id',
         'locale': 'en-US,en',
         'marketingOptIn': True,
     }
     fxa_verified(data)
     upsert_mock.delay.assert_called_with(SUBSCRIBE, {
         'email': data['email'],
         'lang': 'en-US',
         'newsletters': settings.FXA_REGISTER_NEWSLETTER,
         'source_url': settings.FXA_REGISTER_SOURCE_URL,
     })
     fxa_info_mock.assert_called_with(data['email'], 'en-US', data['uid'])
Exemplo n.º 5
0
 def test_with_subscribe(self, upsert_mock, fxa_info_mock):
     data = {
         'email': '*****@*****.**',
         'uid': 'the-fxa-id',
         'locale': 'en-US,en',
         'marketingOptIn': True,
     }
     fxa_verified(data)
     upsert_mock.delay.assert_called_with(
         SUBSCRIBE, {
             'email': data['email'],
             'lang': 'en-US',
             'newsletters': settings.FXA_REGISTER_NEWSLETTER,
             'source_url': settings.FXA_REGISTER_SOURCE_URL,
         })
     fxa_info_mock.assert_called_with(data['email'], 'en-US', data['uid'])
Exemplo n.º 6
0
 def test_with_subscribe_and_metrics(self, upsert_mock, fxa_info_mock):
     data = {
         'email': '*****@*****.**',
         'uid': 'the-fxa-id',
         'locale': 'en-US,en',
         'marketingOptIn': True,
         'metricsContext': {
             'utm_campaign': 'bowling',
             'some_other_thing': 'Donnie',
         }
     }
     fxa_verified(data)
     upsert_mock.delay.assert_called_with(SUBSCRIBE, {
         'email': data['email'],
         'lang': 'en-US',
         'newsletters': settings.FXA_REGISTER_NEWSLETTER,
         'source_url': settings.FXA_REGISTER_SOURCE_URL + '?utm_campaign=bowling',
     })
     fxa_info_mock.assert_called_with(data['email'], 'en-US', data['uid'])
Exemplo n.º 7
0
 def test_with_subscribe_and_metrics(self, upsert_mock, fxa_info_mock):
     data = {
         'email': '*****@*****.**',
         'uid': 'the-fxa-id',
         'locale': 'en-US,en',
         'marketingOptIn': True,
         'metricsContext': {
             'utm_campaign': 'bowling',
             'some_other_thing': 'Donnie',
         }
     }
     fxa_verified(data)
     upsert_mock.delay.assert_called_with(
         SUBSCRIBE, {
             'email':
             data['email'],
             'lang':
             'en-US',
             'newsletters':
             settings.FXA_REGISTER_NEWSLETTER,
             'source_url':
             settings.FXA_REGISTER_SOURCE_URL + '?utm_campaign=bowling',
         })
     fxa_info_mock.assert_called_with(data['email'], 'en-US', data['uid'])