'Test the creation of a CCX on user\'s active states.'

@ddt.data(('auth', True), ('auth', False), ('auth_header_oauth2_provider', True), ('auth_header_oauth2_provider', False))
@ddt.unpack
def test_post_list_on_active_state(self, auth_attr, user_is_active):

    self.app_user.is_active = user_is_active
    self.app_user.save()
    data = {'master_course_id': self.master_course_key_str, 'max_students_allowed': 111, 'display_name': 'CCX    Test    Title', 'coach_email': self.coach.email, 'course_modules': self.master_course_chapters[0:1]}
    resp = self.client.post(self.list_url, data, format='json', HTTP_AUTHORIZATION=getattr(self, auth_attr))
    if (not user_is_active):
        self.assertEqual(resp.status_code, status.HTTP_403_FORBIDDEN)
    else:
        self.assertEqual(resp.status_code, status.HTTP_201_CREATED)
