Skip to content

Commit e2c56bc

Browse files
committed
handle NoneType in error message
1 parent c289109 commit e2c56bc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/formpack/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self, labels=[], translations=[]):
2828
'Mismatched labels and translations: [{}] [{}] '
2929
'{}!={}'.format(
3030
', '.join(labels),
31-
', '.join(translations),
31+
', '.join(map(str, translations)),
3232
len(labels),
3333
len(translations),
3434
)

tests/test_exports.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from formpack import FormPack
1515
from formpack.constants import UNTRANSLATED
16+
from formpack.errors import TranslationError
1617
from formpack.schema.fields import (
1718
ValidationStatusCopyField,
1819
IdCopyField,
@@ -372,9 +373,8 @@ def test_submissions_of_group_exports(self):
372373

373374
def test_translations_labels_mismatch(self):
374375
title, schemas, submissions = build_fixture('translations_labels_mismatch')
375-
fp = FormPack(schemas, title)
376-
options = {'versions': 'v1'}
377-
export = fp.export(**options).to_dict(submissions)
376+
with self.assertRaises(TranslationError) as e:
377+
fp = FormPack(schemas, title)
378378

379379
def test_simple_nested_grouped_repeatable(self):
380380
title, schemas, submissions = build_fixture(

0 commit comments

Comments
 (0)