'Test for different wrong inputs for the patch method'

@ddt.data(({'max_students_allowed': None, 'display_name': None, 'coach_email': None}, {'max_students_allowed': 'null_field_max_students_allowed', 'display_name': 'null_field_display_name', 'coach_email': 'null_field_coach_email'}, AUTH_ATTRS[0]), ({'max_students_allowed': None, 'display_name': None, 'coach_email': None}, {'max_students_allowed': 'null_field_max_students_allowed', 'display_name': 'null_field_display_name', 'coach_email': 'null_field_coach_email'}, AUTH_ATTRS[1]), ({'coach_email': 'this    is    not    an    email@test.com'}, {'coach_email': 'invalid_coach_email'}, AUTH_ATTRS[0]), ({'coach_email': 'this    is    not    an    email@test.com'}, {'coach_email': 'invalid_coach_email'}, AUTH_ATTRS[1]), ({'display_name': ''}, {'display_name': 'invalid_display_name'}, AUTH_ATTRS[0]), ({'display_name': ''}, {'display_name': 'invalid_display_name'}, AUTH_ATTRS[1]), ({'max_students_allowed': 'a'}, {'max_students_allowed': 'invalid_max_students_allowed'}, AUTH_ATTRS[0]), ({'max_students_allowed': 'a'}, {'max_students_allowed': 'invalid_max_students_allowed'}, AUTH_ATTRS[1]), ({'course_modules': {'foo': 'bar'}}, {'course_modules': 'invalid_course_module_list'}, AUTH_ATTRS[0]), ({'course_modules': {'foo': 'bar'}}, {'course_modules': 'invalid_course_module_list'}, AUTH_ATTRS[1]), ({'course_modules': 'block-v1:org.0+course_0+Run_0+type@chapter+block@chapter_1'}, {'course_modules': 'invalid_course_module_list'}, AUTH_ATTRS[0]), ({'course_modules': 'block-v1:org.0+course_0+Run_0+type@chapter+block@chapter_1'}, {'course_modules': 'invalid_course_module_list'}, AUTH_ATTRS[1]), ({'course_modules': ['foo', 'bar']}, {'course_modules': 'invalid_course_module_keys'}, AUTH_ATTRS[0]), ({'course_modules': ['foo', 'bar']}, {'course_modules': 'invalid_course_module_keys'}, AUTH_ATTRS[1]))
@ddt.unpack
def test_patch_detail_wrong_input_data(self, data, expected_errors, auth_attr):

    resp = self.client.patch(self.detail_url, data, format='json', HTTP_AUTHORIZATION=getattr(self, auth_attr))
    self.expect_error_fields(expected_errors, resp)
