From bc915da868afa8bf1a1690537eb7a1b687b38d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans-J=C3=B6rg=20Bibiko?= Date: Tue, 24 Nov 2020 10:32:15 +0100 Subject: [PATCH] fixed contribution/xyz.tab exception; added tests --- ids/templates/contribution/detail_tab.mako | 4 ++-- tests/test_functional.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ids/templates/contribution/detail_tab.mako b/ids/templates/contribution/detail_tab.mako index e8192dc..9696681 100644 --- a/ids/templates/contribution/detail_tab.mako +++ b/ids/templates/contribution/detail_tab.mako @@ -1,4 +1,4 @@ -chapter_id entry_id meaning ${ctx.name|n}_${ctx.default_representation} ${'_'.join([ctx.name, ctx.alt_representation]) + '\t' if ctx.alt_representation else ''|}comment +chapter_id entry_id meaning ${ctx.name|n}_${ctx.default_representation} ${'_'.join([ctx.name, ctx.alt_representation]) + '\t' if ctx.alt_representation else ''|}comment % for vs in sorted(ctx.valuesets, key=lambda vs: tuple(int(c) for c in vs.parameter.id.split('-'))): -${vs.parameter.chapter.id} ${vs.parameter.id.split('-')[1]} ${vs.parameter.name|n} ${'; '.join(v.name for v in vs.values)|n} ${vs.alt_representation + '\t' if ctx.alt_representation else ''|n}${vs.comment|n} +${vs.parameter.chapter.id} ${vs.parameter.id.split('-')[1]} ${vs.parameter.name|n} ${'; '.join(v.name for v in vs.values)|n} ${'; '.join(v.word.alt_name for v in vs.values if v.word.alt_name is not None) + '\t' if ctx.alt_representation else ''|n}${'; '.join(v.comment for v in vs.values if v.comment is not None)|n} % endfor \ No newline at end of file diff --git a/tests/test_functional.py b/tests/test_functional.py index 13092a8..071d526 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -9,6 +9,8 @@ ('get_html', '/contributions/500'), ('get_html', '/contributions.geojson'), ('get_dt', '/contributions'), + ('get_html', '/contributions/28.tab'), + ('get_html', '/contributions/208.tab'), ('get_dt', '/languages'), ('get_html', '/contributions/215'), ('get_dt', '/values?iSortCol_0=5&sSortDir_0=asc&iSortingCols=1'),