Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions tests/integrations/django/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ def test_view_exceptions(sentry_init, client, capture_exceptions, capture_events


def test_ensures_x_forwarded_header_is_honored_in_sdk_when_enabled_in_django(
sentry_init, client, capture_exceptions, capture_events
sentry_init, client, capture_exceptions, capture_events, settings
):
"""
Test that ensures if django settings.USE_X_FORWARDED_HOST is set to True
then the SDK sets the request url to the `HTTP_X_FORWARDED_FOR`
"""
from django.conf import settings

settings.USE_X_FORWARDED_HOST = True

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

settings.USE_X_FORWARDED_HOST = False


def test_ensures_x_forwarded_header_is_not_honored_when_unenabled_in_django(
sentry_init, client, capture_exceptions, capture_events
Expand Down