Return metadata type lookup values as list of unicode not list of strings.

Fixed GitLab issue #310, thank for @fordguo for the find and fix suggestion.
This commit is contained in:
Roberto Rosario
2017-02-12 03:15:49 -04:00
parent 92ac4dc2f7
commit 36db1f4e06
3 changed files with 17 additions and 2 deletions
+13
View File
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.files.base import File
@@ -175,3 +176,15 @@ class MetadataTestCase(TestCase):
self.assertTrue(
self.metadata_type.get_required_for(self.document_type)
)
def test_unicode_lookup(self):
# Should NOT return a ValidationError, otherwise test fails
self.metadata_type.lookup = '测试1,测试2,test1,test2'
self.metadata_type.save()
self.metadata_type.validate_value(document_type=None, value='测试1')
def test_non_unicode_lookup(self):
# Should NOT return a ValidationError, otherwise test fails
self.metadata_type.lookup = 'test1,test2'
self.metadata_type.save()
self.metadata_type.validate_value(document_type=None, value='test1')