Changeset - dbb311201ce3
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-10-20 16:50:00
marcin@python-works.com
add test for enabling lightweight dashboard
1 file changed with 19 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/tests/functional/test_home.py
Show inline comments
 
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):
 

	
 
    def test_index(self):
 
        self.log_user()
 
@@ -56,6 +57,23 @@ merge" class="tooltip" href="/vcs_test_h
 
            assert 'login' in response.location
 
        finally:
 
            anon = User.get_by_username('default')
 
            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)
 

	
0 comments (0 inline, 0 general)