'Test that beta testers can access `self_paced` course prior to start date.'

@patch.dict('courseware.access.settings.FEATURES', {'DISABLE_START_DATES': False})
def test_course_access_to_beta_users(self):

    now = datetime.datetime.now(pytz.UTC)
    one_month_from_now = (now + datetime.timedelta(days=30))
    course_options = {'days_early_for_beta': 100, 'self_paced': True, 'start': one_month_from_now}
    (self_paced_course, self_paced_section) = self.setup_course(**course_options)
    beta_tester = BetaTesterFactory(course_key=self_paced_course.id)
    self.assertTrue(self_paced_course.self_paced)
    self.assertEqual(self_paced_course.start, one_month_from_now)
    self.assertIsNone(self_paced_section.start)
    self.assertFalse(has_access(self.non_staff_user, 'load', self_paced_course))
    self.assertTrue(has_access(beta_tester, 'load', self_paced_course))
    self.assertTrue(has_access(beta_tester, 'load', self_paced_section, self_paced_course.id))
