Skip to content

Commit b9cdcd6

Browse files
authored
Used settings fixture instead of importing django settings (getsentry#1038)
1 parent 3a0bd74 commit b9cdcd6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tests/integrations/django/test_basic.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,12 @@ def test_view_exceptions(sentry_init, client, capture_exceptions, capture_events
4141

4242

4343
def test_ensures_x_forwarded_header_is_honored_in_sdk_when_enabled_in_django(
44-
sentry_init, client, capture_exceptions, capture_events
44+
sentry_init, client, capture_exceptions, capture_events, settings
4545
):
4646
"""
4747
Test that ensures if django settings.USE_X_FORWARDED_HOST is set to True
4848
then the SDK sets the request url to the `HTTP_X_FORWARDED_FOR`
4949
"""
50-
from django.conf import settings
51-
5250
settings.USE_X_FORWARDED_HOST = True
5351

5452
sentry_init(integrations=[DjangoIntegration()], send_default_pii=True)
@@ -62,8 +60,6 @@ def test_ensures_x_forwarded_header_is_honored_in_sdk_when_enabled_in_django(
6260
(event,) = events
6361
assert event["request"]["url"] == "http://example.com/view-exc"
6462

65-
settings.USE_X_FORWARDED_HOST = False
66-
6763

6864
def test_ensures_x_forwarded_header_is_not_honored_when_unenabled_in_django(
6965
sentry_init, client, capture_exceptions, capture_events

0 commit comments

Comments
 (0)