def METHOD_NAME(self) -> None:
    """Test that the background update to populate the `room_type` column in
    `room_stats_state` works properly.
    """
    # Create a room without a type
    room_id = self._generate_room()
    # Get event_id of the m.room.create event
    event_id = self.get_success(
        self.store.db_pool.simple_select_one_onecol(
            table="current_state_events",
            keyvalues={
                "room_id": room_id,
                "type": "m.room.create",
            },
            retcol="event_id",
        )
    )
    # Fake a room creation event with a room type
    event = {
        "content": {
            "creator": "@user:server.org",
            "room_version": "9",
            "type": RoomTypes.SPACE,
        },
        "type": "m.room.create",
    }
    self.get_success(
        self.store.db_pool.simple_update(
            table="event_json",
            keyvalues={"event_id": event_id},
            updatevalues={"json": json.dumps(event)},
            desc="test",
        )
    )
    self.run_background_updates(_BackgroundUpdates.ADD_ROOM_TYPE_COLUMN)
    # Make sure the background update filled in the room type
    room_type_after = self.get_success(
        self.store.db_pool.simple_select_one_onecol(
            table="room_stats_state",
            keyvalues={"room_id": room_id},
            retcol="room_type",
            allow_none=True,
        )
    )
    self.assertEqual(room_type_after, RoomTypes.SPACE)