Skip to content

Commit 3e69ce3

Browse files
committed
fix
1 parent 5342e5e commit 3e69ce3

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/sentry/testutils/pytest/sentry.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,20 @@ def pytest_configure(config: pytest.Config) -> None:
273273
if not hasattr(settings, "SENTRY_OPTIONS"):
274274
settings.SENTRY_OPTIONS = {}
275275

276+
# These were migrated from options to Django settings. Set them directly so
277+
# consumers (which now read the settings) see the test values; the
278+
# option->setting bridge in bootstrap_options would otherwise let a deploy
279+
# default (e.g. getsentry's dev.py) win over an option set here.
280+
settings.SENTRY_BASE_HOSTNAME = "testserver"
281+
settings.SENTRY_ORGANIZATION_BASE_HOSTNAME = "{slug}.testserver"
282+
settings.SENTRY_ORGANIZATION_URL_TEMPLATE = "http://{hostname}"
283+
settings.SENTRY_REGION_API_URL_TEMPLATE = "http://{region}.testserver"
284+
276285
settings.SENTRY_OPTIONS.update(
277286
{
278287
"redis.clusters": {"default": {"hosts": {0: {"db": xdist.get_redis_db()}}}},
279288
"mail.backend": "django.core.mail.backends.locmem.EmailBackend",
280289
"system.url-prefix": "http://testserver",
281-
"system.base-hostname": "testserver",
282-
"system.organization-base-hostname": "{slug}.testserver",
283-
"system.organization-url-template": "http://{hostname}",
284-
"system.region-api-url-template": "http://{region}.testserver",
285290
"system.secret-key": "a" * 52,
286291
"slack.client-id": "slack-client-id",
287292
"slack.client-secret": "slack-client-secret",

0 commit comments

Comments
 (0)