'Extract the generated event tracking context for the given request.'

def get_context_for_request(self, request):

    self.track_middleware.process_request(request)
    try:
        captured_context = tracker.get_tracker().resolve_context()
    finally:
        self.track_middleware.process_response(request, None)
    self.assertEquals(tracker.get_tracker().resolve_context(), {})
    return captured_context
