def METHOD_NAME(self):
    message = "data must be QuerySet-like (have count() and order_by()) or support list(data)"
    class Klass:
        pass
    class Bad:
        def __len__(self):
            pass
    invalid = [None, 1, Klass(), Bad()]
    for data in invalid:
        with self.subTest(data=data), self.assertRaisesMessage(ValueError, message):
            TableData.from_data(data)