def METHOD_NAME(self):
    """
    Make sure that ``as_alias`` performs correctly when used via a join.
    """
    studio = (
        RecordingStudio.objects()
        .create(name="Abbey Road", facilities={"mixing_desk": True})
        .run_sync()
    )
    Instrument.objects().create(name="Guitar", studio=studio).run_sync()
    response = (
        Instrument.select(
            Instrument.name,
            Instrument.studio.facilities.as_alias("studio_facilities"),
        )
        .output(load_json=True)
        .run_sync()
    )
    self.assertListEqual(
        response,
        [{"name": "Guitar", "studio_facilities": {"mixing_desk": True}}],
    )