'Firstly it creates predictions with TreeLearner. Then sends predictions and
different data with different domain to Predictions widget. Those different
data and domain are similar to original data and domain but they have three
different target values instead of two.
GH-2129'

def test_bad_data(self):

    Variable._clear_all_caches()
    filestr1 = '                                age DCTB sex DCTB survived\n                                d DCTB d DCTB d\n                                 DCTB  DCTB class\n                                adult DCTB male DCTB yes\n                                adult DCTB female DCTB no\n                                child DCTB male DCTB yes\n                                child DCTB female DCTB yes\n                                '
    file1 = io.StringIO(filestr1)
    table = TabReader(file1).read()
    learner = TreeLearner()
    tree = learner(table)
    filestr2 = '                                age DCTB sex DCTB survived\n                                d DCTB d DCTB d\n                                 DCTB  DCTB class\n                                adult DCTB male DCTB yes\n                                adult DCTB female DCTB no\n                                child DCTB male DCTB yes\n                                child DCTB female DCTB unknown\n                                '
    file2 = io.StringIO(filestr2)
    bad_table = TabReader(file2).read()
    self.send_signal(self.widget.Inputs.predictors, tree, 1)
    with excepthook_catch():
        self.send_signal(self.widget.Inputs.data, bad_table)
    Variable._clear_all_caches()
