diff --git a/backend/experiment/rules/tests/test_toontjehoger_4_absolute.py b/backend/experiment/rules/tests/test_toontjehoger_4_absolute.py index 27a0f06ba..8f8871b35 100644 --- a/backend/experiment/rules/tests/test_toontjehoger_4_absolute.py +++ b/backend/experiment/rules/tests/test_toontjehoger_4_absolute.py @@ -94,7 +94,7 @@ def test_validate_invalid_tags(self): "Albania 2018 - Eugent Bushpepa,Mall,7.046,45.0,ToontjeHoger4Absolute/audio-5.mp3,c,5\n" "Albania 2018 - Eugent Bushpepa,Mall,7.046,45.0,ToontjeHoger4Absolute/audio-6.mp3,d,6\n" ) - playlist = PlaylistModel.objects.create(name='TestToontjeHoger4Absolute') + playlist = PlaylistModel.objects.create(name='TestToontjeHoger4AbsoluteInvalidTags') playlist.csv = csv_data playlist.update_sections() diff --git a/backend/experiment/rules/toontjehoger_4_absolute.py b/backend/experiment/rules/toontjehoger_4_absolute.py index b725385e5..53b6dacdf 100644 --- a/backend/experiment/rules/toontjehoger_4_absolute.py +++ b/backend/experiment/rules/toontjehoger_4_absolute.py @@ -213,7 +213,12 @@ def validate_playlist(self, playlist: Playlist): errors += self.validate_playlist_groups(groups) # Check if the tags are 'a', 'b' or 'c' - tags = list(playlist.section_set.values_list('tag', flat=True).distinct()) + tags = list( + playlist.section_set + .values_list('tag', flat=True) + .distinct() + .order_by('tag') + ) if tags != ['a', 'b', 'c']: errors.append("Tags in playlist sections should be 'a', 'b' or 'c'. This playlist has tags: {}".format(tags))