Commit 346a2bcf by Nimisha Asthagiri

Move _calculate_bin_for_user into the schedules management command base test class

parent 82978e51
......@@ -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]"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment