Move _calculate_bin_for_user into the schedules management command base test class
This commit is contained in:
@@ -178,9 +178,6 @@ class TestSendRecurringNudge(ScheduleBaseEmailTestBase):
|
||||
|
||||
return sent_messages
|
||||
|
||||
def _calculate_bin_for_user(self, user):
|
||||
return user.id % resolvers.RECURRING_NUDGE_NUM_BINS
|
||||
|
||||
def _contains_upsell_attribute(self, msg_attr):
|
||||
msg = Message.from_string(msg_attr)
|
||||
tmp = msg.context["show_upsell"]
|
||||
|
||||
@@ -71,9 +71,6 @@ class TestUpgradeReminder(ScheduleBaseEmailTestBase):
|
||||
expiration_datetime=datetime.datetime.now(pytz.UTC) + datetime.timedelta(days=30),
|
||||
)
|
||||
|
||||
def _calculate_bin_for_user(self, user):
|
||||
return user.id % resolvers.UPGRADE_REMINDER_NUM_BINS
|
||||
|
||||
@patch.object(tasks, '_upgrade_reminder_schedule_send')
|
||||
def test_dont_send_to_verified_learner(self, mock_schedule_send):
|
||||
upgrade_deadline = datetime.datetime.now(pytz.UTC) + datetime.timedelta(days=2)
|
||||
|
||||
@@ -80,6 +80,9 @@ class ScheduleBaseEmailTestBase(SharedModuleStoreTestCase):
|
||||
|
||||
DynamicUpgradeDeadlineConfiguration.objects.create(enabled=True)
|
||||
|
||||
def _calculate_bin_for_user(self, user):
|
||||
return user.id % self.tested_task.num_bins
|
||||
|
||||
def _get_template_overrides(self):
|
||||
templates_override = deepcopy(settings.TEMPLATES)
|
||||
templates_override[0]['OPTIONS']['string_if_invalid'] = "TEMPLATE WARNING - MISSING VARIABLE [%s]"
|
||||
|
||||
Reference in New Issue
Block a user