Patch random.random from the factory's namespace

This commit is contained in:
Michael Youngstrom
2018-10-01 14:40:36 -04:00
parent 1eb90a230e
commit ed594a9983

View File

@@ -98,7 +98,7 @@ class CreateScheduleTests(SharedModuleStoreTestCase):
@override_waffle_flag(CREATE_SCHEDULE_WAFFLE_FLAG, True)
@patch('analytics.track')
@patch('random.random')
@patch('openedx.core.djangoapps.schedules.signals.random.random', return_value=0.2)
@ddt.data(
(0, True),
(0.1, True),
@@ -113,7 +113,6 @@ class CreateScheduleTests(SharedModuleStoreTestCase):
mock_track,
mock_get_current_site
):
mock_random.return_value = 0.2
schedule_config = ScheduleConfigFactory.create(enabled=True, hold_back_ratio=hold_back_ratio)
mock_get_current_site.return_value = schedule_config.site
if expect_schedule_created: