Permalink
Browse files

fixed unicode decoding error in audio tags

  • Loading branch information...
spiccinini committed Oct 8, 2018
1 parent 3a78ab4 commit 2824ee324a129f993c7abe961ac3683d486343d4
Showing with 7 additions and 1 deletion.
  1. +1 −1 redpanal/audio/models.py
  2. +6 −0 redpanal/audio/tests.py
View
@@ -103,7 +103,7 @@ def get_absolute_url(self):
return reverse('audio-detail', kwargs={'slug': self.slug})
def get_tags(self):
return [str(t) for t in self.tags.all()]
return [unicode(t) for t in self.tags.all()]
def __unicode__(self):
return self.name
View
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import os
from django.test import TestCase
@@ -41,6 +42,11 @@ def test_agregar_tags_a_un_audio(self):
self.assertTrue(Audio.objects.filter(tags__name__in=["rock"]))
self.assertFalse(Audio.objects.filter(tags__name__in=["Rock"]))
def test_add_unicode_tags(self):
audio = self.create_instance()
audio.tags.add("rock", "MiProject", u"guitarræ")
self.assertTrue(u"guitarræ" in audio.get_tags())
def create_audio_form_data(self, filename, content_type):
data = {"name": "test audio", "description": "This is a test audio",
"project": self.project.pk,

0 comments on commit 2824ee3

Please sign in to comment.