Skip to content
Snippets Groups Projects
Commit 2a89f487 authored by Daniel Levy's avatar Daniel Levy
Browse files

Fix configuration and encoding errors

parent 2d834b82
No related branches found
No related tags found
2 merge requests!166Staging,!155Fix configuration and encoding errors
Pipeline #9625 passed
......@@ -74,7 +74,7 @@
"model": "chn_spreadsheet.sheetprofile",
"pk": 4
},
{"model": "chn_spreadsheet.sheetprofile", "pk": 5, "fields": {"label": "kobo_master", "profile": "{\"name\":\"(Redundant)\",\"format\":\"excel\",\"label\":\"kobo_master\",\"skip_header\":1,\"taxonomies\":{},\"columns\":[{\"field\":\"timestamp\",\"type\":\"date\",\"name\":\"Date\",\"date_format\":\"%Y-%m-%dT%H: %M: %S.%f%z\"},{\"field\":\"body\",\"type\":\"text\",\"name\":\"Feedback\"},{\"field\":\"translation\",\"type\":\"text\",\"name\":\"Translation\"},{\"field\":\"ignore\",\"type\":\"ignore\",\"name\":\"Theme\"},{\"field\":\"terms\",\"type\":\"taxonomy\",\"name\":\"Tags\",\"taxonomy\":\"tags\"},{\"field\":\"ignore\",\"type\":\"ignore\",\"name\":\"FB Category\"},{\"field\":\"gender\",\"type\":\"text\",\"name\":\"Gender\"},{\"field\":\"age\",\"type\":\"text\",\"name\":\"Age\"},{\"field\":\"location\",\"type\":\"text\",\"name\":\"Location\"},{\"field\":\"enumerator\",\"type\":\"text\",\"name\":\"Ennumerator\"},{\"field\":\"source\",\"type\":\"text\",\"name\":\"Source\"}]}"}},
{"model": "chn_spreadsheet.sheetprofile", "pk": 5, "fields": {"label": "kobo_master", "profile": "{\"name\":\"(Redundant)\",\"format\":\"excel\",\"label\":\"kobo_master\",\"skip_header\":1,\"taxonomies\":{},\"columns\":[{\"field\":\"timestamp\",\"type\":\"date\",\"name\":\"Date\",\"date_format\":\"%Y-%m-%dT%H: %M: %S.%f%z\"},{\"field\":\"body\",\"type\":\"text\",\"name\":\"Feedback\"},{\"field\":\"translation\",\"type\":\"text\",\"name\":\"Translation\"},{\"field\":\"ignore\",\"type\":\"ignore\",\"name\":\"Theme\"},{\"field\":\"terms\",\"type\":\"taxonomy\",\"name\":\"Tags\",\"taxonomy\":\"tags\"},{\"field\":\"ignore\",\"type\":\"ignore\",\"name\":\"FB Category\"},{\"field\":\"gender\",\"type\":\"text\",\"name\":\"Gender\"},{\"field\":\"age\",\"type\":\"text\",\"name\":\"Age\"},{\"field\":\"location\",\"type\":\"text\",\"name\":\"Location\"},{\"field\":\"enumerator\",\"type\":\"text\",\"name\":\"Enumerator\"}]}"}},
{
"fields": {
"name": "main"
......
......@@ -69,6 +69,16 @@
"model": "taxonomies.taxonomy",
"pk": 8
},
{
"fields": {
"multiplicity": "optional",
"name": "drc",
"slug": "drc",
"vocabulary": "closed"
},
"model": "taxonomies.taxonomy",
"pk": 9
},
{
"fields": {
"long_name": "Question",
......
......@@ -124,9 +124,9 @@ class Term(models.Model):
)
def __unicode__(self):
return "{0}:{1}".format(
return u"{0}:{1}".format(
self.taxonomy.name,
self.name
self.name,
)
# Custom Manager
......
# -*- coding: UTF-8 -*-
from __future__ import absolute_import, unicode_literals
import pytest
......@@ -60,3 +61,10 @@ def test_unknown_term_by_taxonomy_throws_exception_if_not_open():
)
assert excinfo.value.message == "Term matching query does not exist."
@pytest.mark.django_db
def test_taxonomy_terms_can_include_unicode_characters():
term = TermFactory(name="Sécurité alimentaire")
expected_unicode = u'{0}:Sécurité alimentaire'.format(term.taxonomy.name)
assert expected_unicode == unicode(term)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment