# HG changeset patch # User Marcin Kuzminski # Date 1350744600 -7200 # Node ID dbb311201ce3da3c3b9d39c8186d1cb5f2bbc725 # Parent 68e95f5ae3a7c6c3716eea7ce970fdf16d0d0500 add test for enabling lightweight dashboard diff -r 68e95f5ae3a7 -r dbb311201ce3 rhodecode/tests/functional/test_home.py --- a/rhodecode/tests/functional/test_home.py Sat Oct 20 14:50:38 2012 +0200 +++ b/rhodecode/tests/functional/test_home.py Sat Oct 20 16:50:00 2012 +0200 @@ -1,7 +1,8 @@ import time from rhodecode.tests import * from rhodecode.model.meta import Session -from rhodecode.model.db import User +from rhodecode.model.db import User, RhodeCodeSetting, Repository +from rhodecode.lib.utils import set_rhodecode_config class TestHomeController(TestController): @@ -59,3 +60,20 @@ anon.active = True Session().add(anon) Session().commit() + + def test_index_with_lightweight_dashboard(self): + self.log_user() + + def set_l_dash(set_to): + self.app.post(url('admin_setting', setting_id='visual'), + params=dict(_method='put', + rhodecode_lightweight_dashboard=set_to,)) + + set_l_dash(True) + + try: + response = self.app.get(url(controller='home', action='index')) + response.mustcontain("""var data = {"totalRecords": %s""" % len(Repository.getAll())) + finally: + set_l_dash(False) +