def test_setData(self, dataframe, language_values, qtbot):
        model = ColumnDtypeModel(dataFrame=dataframe)
        index = model.index(3, 1)
        model.setEditable(True)

        # change all values except datetime
        datetime = ()
        for (expected_type, string) in language_values:
            if expected_type == numpy.dtype('<M8[ns]'):
                datetime = (string, expected_type)
                continue
            else:
                model.setData(index, string)
                assert index.data(DTYPE_ROLE) == expected_type

        assert model.setData(index, 'bool', Qt.DisplayRole) == False

        with pytest.raises(Exception) as err:
            model.setData(index, datetime[0])
        assert str(err.value) in "Can't convert a boolean value into a datetime value"

        # rewrite this with parameters
        for data in [
                ["2012-12-13"],
                ["2012-12-13 19:10"],
                ["2012-12-13 19:10:10"]
        ]:
            df = pandas.DataFrame(data, columns=["datetime"])
            model = ColumnDtypeModel(dataFrame=df)
            index = model.index(0, 0)
            model.setEditable(True)
            assert model.setData(index, "date and time") == True

        # convert datetime to anything else does not work and leave the
        # datatype unchanged. An error message is emitted.

        with qtbot.waitSignal(model.changeFailed):
            model.setData(index, 'bool')
dataset/ETHPy150Open datalyze-solutions/pandas-qt/tests/test_CustomDTypeModel.py/TestColumnDType.test_setData/swapped operands of `in`