Changeset - 54fda6ce9e98
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 14 years ago 2011-11-21 01:53:17
marcin@python-works.com
fixes timezone issues with tests
2 files changed with 10 insertions and 13 deletions:
0 comments (0 inline, 0 general)
rhodecode/tests/__init__.py
Show inline comments
 
@@ -5,29 +5,32 @@ when this script is imported from the `n
 
command.
 

	
 
This module initializes the application via ``websetup`` (`paster
 
setup-app`) and provides the base testing objects.
 
"""
 
import os
 
import time
 
from os.path import join as jn
 

	
 
from unittest import TestCase
 

	
 
from paste.deploy import loadapp
 
from paste.script.appinstall import SetupCommand
 
from pylons import config, url
 
from routes.util import URLGenerator
 
from webtest import TestApp
 

	
 
from rhodecode.model import meta
 
import logging
 
import pylons.test
 

	
 
os.environ['TZ'] = 'UTC'
 
time.tzset()
 

	
 
log = logging.getLogger(__name__)
 

	
 
import pylons.test
 

	
 
__all__ = ['environ', 'url', 'TestController', 'TESTS_TMP_PATH', 'HG_REPO',
 
           'GIT_REPO', 'NEW_HG_REPO', 'NEW_GIT_REPO', 'HG_FORK', 'GIT_FORK',
 
           'TEST_USER_ADMIN_LOGIN', 'TEST_USER_ADMIN_PASS' ]
 

	
 
# Invoke websetup with the current config file
 
# SetupCommand('setup-app').run([config_file])
rhodecode/tests/functional/test_changelog.py
Show inline comments
 
@@ -9,24 +9,24 @@ class TestChangelogController(TestContro
 

	
 
        self.assertTrue("""<div id="chg_20" class="container">"""
 
                        in response.body)
 
        self.assertTrue("""<input class="changeset_range" id="5e204e7583b9" """
 
                        """name="5e204e7583b9" type="checkbox" value="1" />"""
 
                        in response.body)
 
        self.assertTrue("""<span>commit 154: 5e204e7583b9@2010-08-10 """
 
                        """02:18:46</span>""" in response.body)
 
        self.assertTrue("""<span>commit 154: 5e204e7583b9@2010-08-09 """
 
                        """23:18:46</span>""" in response.body)
 

	
 
        self.assertTrue("""Small update at simplevcs app""" in response.body)
 

	
 

	
 
        self.assertTrue("""<span id="5e204e7583b9c8e7b93a020bd036564b1e"""
 
                        """731dae" class="changed_total tooltip" """
 
                        """title="Affected number of files, click to """
 
                        """show more details">3</span>""" in response.body)
 

	
 
        #pagination
 

	
 
        response = self.app.get(url(controller='changelog', action='index',
 
                                    repo_name=HG_REPO), {'page':1})
 
        response = self.app.get(url(controller='changelog', action='index',
 
                                    repo_name=HG_REPO), {'page':2})
 
        response = self.app.get(url(controller='changelog', action='index',
 
                                    repo_name=HG_REPO), {'page':3})
 
@@ -39,23 +39,17 @@ class TestChangelogController(TestContro
 

	
 

	
 
        # Test response after pagination...
 
        self.assertTrue("""<input class="changeset_range" id="46ad32a4f974" """
 
                        """name="46ad32a4f974" type="checkbox" value="1" />"""
 
                        in response.body)
 
        self.assertTrue("""<span>commit 64: 46ad32a4f974@2010-04-20"""
 
                        """ 01:33:21</span>"""in response.body)
 
        self.assertTrue("""<span>commit 64: 46ad32a4f974@2010-04-19"""
 
                        """ 22:33:21</span>"""in response.body)
 

	
 
        self.assertTrue("""<span id="46ad32a4f974e45472a898c6b0acb600320"""
 
                        """579b1" class="changed_total tooltip" """
 
                        """title="Affected number of files, click to """
 
                        """show more details">21</span>"""in response.body)
 
        self.assertTrue("""<div class="message"><a href="/%s/changeset/"""
 
                        """46ad32a4f974e45472a898c6b0acb600320579b1">"""
 
                        """Merge with 2e6a2bf9356ca56df08807f4ad86d48"""
 
                        """0da72a8f4</a></div>""" % HG_REPO in response.body)
 

	
 

	
 

	
 
    #def test_index_git(self):
 
    #    self.log_user()
 
    #    response = self.app.get(url(controller='changelog', action='index', repo_name=GIT_REPO))
0 comments (0 inline, 0 general)