Assign new sailthru var upon signup.
In SailThru, randomly set a var value of 0-9 on each user upon signup. LEARNER-4177
This commit is contained in:
@@ -3,6 +3,7 @@ This module contains signals needed for email integration
|
||||
"""
|
||||
import datetime
|
||||
import logging
|
||||
from random import randint
|
||||
|
||||
import crum
|
||||
from django.conf import settings
|
||||
@@ -210,6 +211,7 @@ def _create_sailthru_user_vars(user, profile, registration=None):
|
||||
|
||||
if registration:
|
||||
sailthru_vars['activation_key'] = registration.activation_key
|
||||
sailthru_vars['signupNumber'] = randint(0, 9)
|
||||
|
||||
return sailthru_vars
|
||||
|
||||
|
||||
@@ -483,6 +483,7 @@ class EmailMarketingTests(TestCase):
|
||||
email_marketing_register_user(None, user=self.user, registration=self.registration)
|
||||
self.assertTrue(mock_update_user.called)
|
||||
self.assertEqual(mock_update_user.call_args[0][0]['activation_key'], self.registration.activation_key)
|
||||
self.assertLessEqual(mock_update_user.call_args[0][0]['signupNumber'], 9)
|
||||
|
||||
@patch('lms.djangoapps.email_marketing.tasks.update_user.delay')
|
||||
def test_register_user_no_request(self, mock_update_user):
|
||||
|
||||
Reference in New Issue
Block a user