예제 #1
0
 def test_get_helpers(self):
     app = Flask(__name__)
     app.config['THEME_PATHS'] = [join(TESTS, 'morethemes')]
     setup_themes(app, app_identifier='testing')
     
     with app.test_request_context('/'):
         cool = app.theme_manager.themes['cool']
         plain = app.theme_manager.themes['plain']
         assert get_theme('cool') is cool
         assert get_theme('plain') is plain
         tl = get_themes_list()
         assert tl[0] is cool
         assert tl[1] is plain
         try:
             get_theme('notthis')
         except KeyError:
             pass
         else:
             raise AssertionError("Getting a nonexistent theme should "
                                  "raised KeyError")
예제 #2
0
def themes():
    themes = get_themes_list()
    return render('themes.html', themes=themes)
예제 #3
0
파일: admin.py 프로젝트: yxm0513/flask-ims
def themes():
    themes = get_themes_list()
    return render_template("admin/themes.html", themes=themes)
예제 #4
0
def themes_list():
    _themes = themes.get_themes_list()
    return render('themes/list.html', themes=_themes)