Skip to content

Commit 6be5135

Browse files
committed
Add test for datasource type exclusion
1 parent 32cef44 commit 6be5135

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/tasks/test_refresh_schemas.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from mock import patch
22

3+
from redash import settings
34
from redash.tasks import refresh_schemas
45
from tests import BaseTestCase
56

@@ -23,3 +24,11 @@ def test_skips_paused_data_sources(self):
2324
with patch("redash.tasks.queries.maintenance.refresh_schema.delay") as refresh_job:
2425
refresh_schemas()
2526
refresh_job.assert_called()
27+
28+
def test_skips_excluded_datasource_types(self):
29+
ds = self.factory.data_source
30+
31+
with patch.object(settings, "SCHEMAS_REFRESH_EXCLUDED_TYPES", {ds.type}):
32+
with patch("redash.tasks.queries.maintenance.refresh_schema.delay") as refresh_job:
33+
refresh_schemas()
34+
refresh_job.assert_not_called()

0 commit comments

Comments
 (0)