'Test sparse data.
GH-2152
GH-2157'

def test_sparse(self):

    table = Table('iris')
    table.X = sp.csr_matrix(table.X)
    self.assertTrue(sp.issparse(table.X))
    table.Y = sp.csr_matrix(table._Y)
    self.assertTrue(sp.issparse(table.Y))
    self.send_signal(self.widget.Inputs.data, table)
    self.widget.set_subset_data(table[:30])
    data = self.get_output('Data')
    self.assertTrue(data.is_sparse())
    self.assertEqual(len(data.domain), 5)
