'Check if combo box content is properly set for merging option
\'Concatenate tables, merge rows\''

def test_combobox_items_outer(self):

    (domainA, domainB) = (self.dataA.domain, self.dataB.domain)
    data_combo = self.widget.controls.attr_combine_data
    extra_combo = self.widget.controls.attr_combine_extra
    self.send_signal(self.widget.Inputs.data, self.dataA)
    self.send_signal(self.widget.Inputs.extra_data, self.dataA)
    self.widget.controls.merging.buttons[1].click()
    data_items = extra_items = list(chain([INSTANCEID, INDEX], domainA.variables[::2], domainA.metas[1:]))
    self.assertListEqual(data_combo.model()[:], data_items)
    self.assertListEqual(extra_combo.model()[:], extra_items)
    self.send_signal(self.widget.Inputs.extra_data, self.dataB)
    data_items = list(chain([INDEX], domainA.variables[::2], domainA.metas[1:]))
    extra_items = list(chain([INDEX], domainB, domainB.metas))
    self.assertListEqual(data_combo.model()[:], data_items)
    self.assertListEqual(extra_combo.model()[:], extra_items)
    self.send_signal(self.widget.Inputs.data, self.dataB)
    data_items = extra_items = list(chain([INSTANCEID, INDEX], domainB, domainB.metas))
    self.assertListEqual(data_combo.model()[:], data_items)
    self.assertListEqual(extra_combo.model()[:], extra_items)
