'Test that the course serializer will work when passed a string or list.
Internally, DRF passes the data into the value conversion method as a list instead of
a string, so StringListField needs to work with both.'

def test_course_list_serializer(self):

    for key in [self.course_key, [self.course_key]]:
        serializer = BulkEnrollmentSerializer(data={'identifiers': 'percivaloctavius', 'action': 'enroll', 'email_students': False, 'courses': key})
        self.assertTrue(serializer.is_valid())
