'refresh_queries() does not launch execution tasks for queries whose
data source is paused.'

def test_doesnt_enqueue_outdated_queries_for_paused_data_source(self):

    query = self.factory.create_query()
    oq = staticmethod((lambda : [query]))
    query.data_source.pause()
    with patch.object(Query, 'outdated_queries', oq):
        with patch('redash.tasks.queries.enqueue_query') as add_job_mock:
            refresh_queries()
            add_job_mock.assert_not_called()
        query.data_source.resume()
        with patch('redash.tasks.queries.enqueue_query') as add_job_mock:
            refresh_queries()
            add_job_mock.assert_called_with(query.query_text, query.data_source, query.user_id, scheduled_query=query, metadata=ANY)
