def METHOD_NAME(self, mock_geo_by_addr):
    mock_geo_by_addr.return_value = {
        "country_code": "US",
        "region": "CA",
        "subdivision": "San Francisco",
    }
    request = self.request
    request.META["REMOTE_ADDR"] = "8.8.8.8"
    with assume_test_silo_mode(SiloMode.MONOLITH):
        assert login(request, self.user)
    with outbox_runner():
        self.middleware.process_request(request)
    # Should be logged in and have logged a UserIp record.
    assert request.user.id == self.user.id
    assert mock_geo_by_addr.call_count == 1
    with assume_test_silo_mode(SiloMode.CONTROL):
        userip = UserIP.objects.get(user=self.user)
    assert userip.ip_address == "8.8.8.8"
    assert userip.country_code == "US"
    assert userip.region_code == "CA"