Skip to content

Commit 5ede78a

Browse files
eli-r-phclaude
andcommitted
test(django): read the middleware context test's event after defaults fill
On v1, context properties are filled inside _enqueue, before before_send. The test patched _enqueue itself, so it saw the event before the fill and lost $request_path and role. It now records the event in before_send. The assertions are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7e735cb commit 5ede78a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎posthog/test/integrations/test_middleware_api.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ async def async_view(request):
153153
),
154154
patch.object(
155155
client,
156-
"_enqueue",
157-
side_effect=lambda message, *args, **kwargs: captured.append(message),
156+
"before_send",
157+
new=lambda message: captured.append(message),
158158
),
159159
):
160160
middleware = PosthogContextMiddleware(async_view if asynchronous else view)

0 commit comments

Comments
 (0)