Fix #5079 - tags unicity is on the slug, not the name

Signed-off-by: Loic Dachary <loic@dachary.org>
Signed-off-by: Andrew Browning <ayleph@thisshitistemp.com>
This commit is contained in:
Loic Dachary
2016-01-25 19:08:52 +07:00
committed by Andrew Browning
parent 05f26e3abc
commit 679f729221
2 changed files with 10 additions and 6 deletions

View File

@@ -33,6 +33,10 @@ def test_list_of_dicts_conversion(test_app):
assert text.convert_to_tag_list_of_dicts('echo,echo') == [{'name': u'echo',
'slug': u'echo'}]
# When checking for duplicates, use the slug, not the tag
assert text.convert_to_tag_list_of_dicts('echo,#echo') == [{'name': u'#echo',
'slug': u'echo'}]
# Make sure converting the list of dicts to a string works
assert text.media_tags_as_string([{'name': u'yin', 'slug': u'yin'},
{'name': u'yang', 'slug': u'yang'}]) == \