def test_get_old_song_with_multiple_download_records(self):
        """Old songs may have multiple download records. Get the latest."""
        user = self.gw.create_or_update_user(
            'username', visible_name='Visible Name', max_storage_bytes=1)
        udf = self.factory.make_user_volume(
            owner=user._user, path='~/path/name')

        file_path = 'path'
        download_key = 'mydownloadkey'
        download1_url = 'http://download/url/1'
        download1 = self.gw.make_download(
            user.id, udf.id, file_path, download1_url, download_key)

        download2_url = 'http://download/url/2'
        download2 = self.gw.make_download(
            user.id, udf.id, file_path, download2_url, download_key)
        assert download1.status_change_date < download2.status_change_date
        download = self.gw.get_download(
            user.id, udf.id, file_path, download1_url, download_key)
        self.assertNotEqual(download.id, download1.id)
        self.assertEqual(download.id, download2.id)