From 8a586ec506d9ab4a5275c06ee8bef251b8bdf1b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Sat, 21 Mar 2026 16:48:50 +0000 Subject: [PATCH] Add test for original_date --- test/autotag/test_hooks.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/test/autotag/test_hooks.py b/test/autotag/test_hooks.py index 6d27035f3..b5c99e21c 100644 --- a/test/autotag/test_hooks.py +++ b/test/autotag/test_hooks.py @@ -45,11 +45,17 @@ def test_genre_deprecation(genre, expected_genres): class ApplyTest(BeetsTestCase): - def _apply(self, per_disc_numbering=False, artist_credit=False): + def _apply( + self, + per_disc_numbering=False, + artist_credit=False, + original_date=False, + ): info = self.info mapping = dict(zip(self.items, info.tracks)) self.config["per_disc_numbering"] = per_disc_numbering self.config["artist_credit"] = artist_credit + self.config["original_date"] = original_date amatch = AlbumMatch(0, self.info, mapping) amatch.apply_metadata() @@ -216,6 +222,23 @@ class ApplyTest(BeetsTestCase): assert self.items[0].month == 2 assert self.items[0].day == 3 + def test_original_date_overrides_release_date(self): + self.items = [Item(year=1, month=2, day=3)] + self.info.update( + year=2013, + month=12, + day=18, + original_year=1999, + original_month=4, + original_day=7, + ) + + self._apply(original_date=True) + + assert self.items[0].year == 1999 + assert self.items[0].month == 4 + assert self.items[0].day == 7 + @pytest.mark.parametrize( "overwrite_fields,expected_item_artist",