changeset 2946:dbb311201ce3 beta

add test for enabling lightweight dashboard
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 20 Oct 2012 16:50:00 +0200
parents 68e95f5ae3a7
children 01f5633ee68b
files rhodecode/tests/functional/test_home.py
diffstat 1 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)
+