Mark MoveEffect.effect as a Markdown column.

Also relax the appropriate test
This commit is contained in:
Petr Viktorin 2011-04-12 08:57:30 +03:00
parent f42f5f32d0
commit 10d9bc83b3
2 changed files with 3 additions and 2 deletions

View file

@ -805,7 +805,7 @@ create_translation_table('move_effect_prose', MoveEffect, 'prose',
short_effect = Column(Unicode(256), nullable=True,
info=dict(description="A short summary of the effect", format='plaintext')),
effect = Column(Unicode(5120), nullable=True,
info=dict(description="A detailed description of the effect", format='plaintext')),
info=dict(description="A detailed description of the effect", format='markdown')),
)
class MoveEffectChangelog(TableBase):

View file

@ -181,7 +181,8 @@ def test_texts():
if format not in good_formats:
raise AssertionError(assert_text % column)
is_markdown = isinstance(column.type, markdown.MarkdownColumn)
if is_markdown != (format == 'markdown'):
if is_markdown and (format != 'markdown'):
# Note: regular string with markdown syntax is allowed
raise AssertionError('%s: markdown format/column type mismatch' % column)
if (format != 'identifier') and (column.name == 'identifier'):
raise AssertionError('%s: identifier column name/type mismatch' % column)