'Tests that the MobileAvailabilityError() is raised for certain user
roles when trying to access course content. Also verifies that if
the IgnoreMobileAvailableFlagConfig is enabled,
MobileAvailabilityError() will not be raised for all user roles.'

@ddt.data((auth.CourseBetaTesterRole, True), (auth.CourseStaffRole, True), (auth.CourseInstructorRole, True), (None, False))
@ddt.unpack
@patch.dict(settings.FEATURES, {'ENABLE_MKTG_SITE': True})
def test_non_mobile_available(self, role, should_succeed):

    self.init_course_access()
    self.course.mobile_available = False
    self.store.update_item(self.course, self.user.id)
    self._verify_response(should_succeed, MobileAvailabilityError(), role)
    IgnoreMobileAvailableFlagConfig(enabled=True).save()
    self._verify_response(True, MobileAvailabilityError(), role)
