Move _calculate_bin_for_user into the schedules management command base test class

This commit is contained in:
Nimisha Asthagiri
2017-10-26 09:11:03 -04:00
parent 82978e516c
commit 346a2bcf2a
3 changed files with 3 additions and 6 deletions

View File

@@ -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"]

View File

@@ -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)

View File

@@ -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]"