Skip to content

Commit 62bac19

Browse files
cursoragentarmenzg
andcommitted
fix(tests): Add @override_options decorator to test_skipped_when_disabled
With the default for viewer-context.enabled changed to True, the test test_skipped_when_disabled needs to explicitly override the option to False to test the disabled behavior. Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
1 parent fa5498b commit 62bac19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/sentry/middleware/test_viewer_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ def setUp(self):
103103
super().setUp()
104104
self.factory = RequestFactory()
105105

106+
@override_options({"viewer-context.enabled": False})
106107
def test_skipped_when_disabled(self):
107108
captured: list = []
108109

109110
def get_response(request):
110111
captured.append(get_viewer_context())
111112
return MagicMock(status_code=200)
112113

113-
# Default: viewer-context.enabled is False
114114
middleware = ViewerContextMiddleware(get_response)
115115

116116
request = self.factory.get("/")

0 commit comments

Comments
 (0)