'``execute_query`` invokes the query runner and stores a query result.'

def test_success(self):

    cm = mock.patch('celery.app.task.Context.delivery_info', {'routing_key': 'test'})
    with cm:
        with mock.patch.object(PostgreSQL, 'run_query') as qr:
            qr.return_value = ([1, 2], None)
            result_id = execute_query('SELECT    1,    2', self.factory.data_source.id, {})
            self.assertEqual(1, qr.call_count)
            result = models.QueryResult.query.get(result_id)
            self.assertEqual(result.data, '{1,2}')
