Skip to content
Snippets Groups Projects
Commit 9551b23d authored by Albert (AJ) St. Aubin's avatar Albert (AJ) St. Aubin
Browse files

[MICROBA-721] Updates the notify_credentials job to run over new window

parent 1858e288
No related branches found
No related merge requests found
......@@ -184,8 +184,8 @@ class Command(BaseCommand):
options = self.get_args_from_database()
if options['auto']:
options['end_date'] = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
options['start_date'] = options['end_date'] - timedelta(days=1)
options['end_date'] = datetime.now().replace(minute=0, second=0, microsecond=0)
options['start_date'] = options['end_date'] - timedelta(hours=4)
log.info(
u"notify_credentials starting, dry-run=%s, site=%s, delay=%d seconds, page_size=%d, "
......
......@@ -69,20 +69,20 @@ class TestNotifyCredentials(TestCase):
self.assertEqual(list(mock_send.call_args[0][0]), [self.cert1, self.cert2])
self.assertEqual(list(mock_send.call_args[0][1]), [self.grade1, self.grade2])
@freeze_time(datetime(2017, 5, 2))
@freeze_time(datetime(2017, 5, 1, 4))
@mock.patch(COMMAND_MODULE + '.Command.send_notifications')
def test_auto_execution(self, mock_send):
cert_filter_args = {}
with freeze_time(datetime(2017, 5, 1)):
with freeze_time(datetime(2017, 5, 1, 0)):
cert1 = GeneratedCertificateFactory(user=self.user, course_id='course-v1:edX+Test+11')
with freeze_time(datetime(2017, 5, 2)):
with freeze_time(datetime(2017, 5, 1, 3)):
cert2 = GeneratedCertificateFactory(user=self.user, course_id='course-v1:edX+Test+22')
with freeze_time(datetime(2017, 5, 1)):
with freeze_time(datetime(2017, 5, 1, 0)):
grade1 = PersistentCourseGrade.objects.create(user_id=self.user.id, course_id='course-v1:edX+Test+11',
percent_grade=1)
with freeze_time(datetime(2017, 5, 2)):
with freeze_time(datetime(2017, 5, 1, 3)):
grade2 = PersistentCourseGrade.objects.create(user_id=self.user.id, course_id='course-v1:edX+Test+22',
percent_grade=1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment