'Regression test for https://github.com/divio/django-filer/pull/945.
Because of a wrong unquoting function being used, searches with
some "_XX" sequences got unquoted as unicode characters.
For example, "_ec" gets unquoted as u\'Ã¬\'.'

def test_search_special_characters(self):

    url = reverse('admin:filer-directory_listing', kwargs={'folder_id': self.parent.id})
    problematic_file = django.core.files.base.ContentFile('some    data')
    filename = u'christopher_eccleston'
    problematic_file.name = filename
    self.spam_file = File.objects.create(owner=self.staff_user, original_filename=filename, file=problematic_file, folder=self.parent)
    response = self.client.get(url, {'q': filename})
    item_list = response.context['paginated_items'].object_list
    self.assertEqual(len(item_list), 1)
