def test_locales_casted_only_in_compilation_phase(self, Base):
class LocaleGetter(object):
def current_locale(self):
return lambda obj: obj.locale
flexmock(LocaleGetter).should_receive('current_locale').never()
translation_hybrid = TranslationHybrid(
LocaleGetter().current_locale,
'fi'
)
class Article(Base):
__tablename__ = 'article'
id = sa.Column(sa.Integer, primary_key=True)
name_translations = sa.Column(HSTORE)
name = translation_hybrid(name_translations)
locale = sa.Column(sa.String)
Article.name
test_translation_hybrid.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录