Commit 08a8a8dc authored by Roman Zimmermann's avatar Roman Zimmermann

Extend test for translateable column labels to cover active_filters.

parent 91fae266
......@@ -6,6 +6,7 @@ from speaklater import make_lazy_string
from . import setup
from .test_basic import CustomModelView, create_models
class Translator:
translate = False
......@@ -15,6 +16,7 @@ class Translator:
else:
return string
def test_column_label_translation():
app, db, admin = setup()
......@@ -27,8 +29,14 @@ def test_column_label_translation():
column_list=['test1', 'test3'],
column_labels=dict(test1=label),
column_filters=('test1',))
admin.add_view(view)
translated.translate = True
non_lazy_groups = view._get_filter_groups()
json.dumps(non_lazy_groups) # Filter dict is JSON serializable.
ok_(translated('Column1') in non_lazy_groups) # Label was translated.
client = app.test_client()
# Render index with active filter.
rv = client.get('/admin/model1/?flt1_0=test')
eq_(rv.status_code, 200)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment