Changeset - e94f4e54dc03
[Not reviewed]
default
0 4 1
Marcin Kuzminski - 15 years ago 2010-09-11 03:35:33
marcin@python-works.com
tests fix, put vcs testing tarball
3 files changed:
0 comments (0 inline, 0 general)
pylons_app/config/environment.py
Show inline comments
 
@@ -49,10 +49,10 @@ def load_environment(global_conf, app_co
 

	
 
    #sets the c attribute access when don't existing attribute are accessed
 
    config['pylons.strict_tmpl_context'] = True
 
    
 
    test = os.path.split(config['__file__'])[-1] == 'tests.ini'
 
    #MULTIPLE DB configs
 
    # Setup the SQLAlchemy database engine
 
    if config['debug'] and os.path.split(config['__file__'])[-1] != 'tests.ini':
 
    if config['debug'] and not test:
 
        #use query time debugging.
 
        from pylons_app.lib.timerproxy import TimerProxy
 
        sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.',
pylons_app/tests/__init__.py
Show inline comments
 
@@ -31,7 +31,6 @@ class TestController(TestCase):
 
        wsgiapp = pylons.test.pylonsapp
 
        config = wsgiapp.config
 
        self.app = TestApp(wsgiapp)
 
        self.session = session
 
        url._push_object(URLGenerator(config['routes.map'], environ))
 
        self.sa = meta.Session
 
        TestCase.__init__(self, *args, **kwargs)
pylons_app/tests/functional/test_search.py
Show inline comments
 
from pylons_app.tests import *
 
from pylons_app.lib.indexers import IDX_LOCATION
 
import os
 
from nose.plugins.skip import SkipTest
 

	
 
class TestSearchController(TestController):
 

	
 
@@ -10,6 +13,17 @@ class TestSearchController(TestControlle
 
        # Test response...
 

	
 
    def test_empty_search(self):
 
        
 
        if os.path.isdir(IDX_LOCATION):
 
            raise SkipTest('skipped due to existing index')
 
        else:
 
            self.log_user()
 
            response = self.app.get(url(controller='search', action='index'),{'q':'vcs_test'})
 
            assert 'There is no index to search in. Please run whoosh indexer' in response.body,'No error message about empty index'
 
        
 
    def test_normal_search(self):
 
        self.log_user()
 
        response = self.app.get(url(controller='search', action='index'),{'q':'vcs_test'})
 
        assert 'There is no index to search in. Please run whoosh indexer' in response.body,'No error message about empty index'
 
\ No newline at end of file
 
        response = self.app.get(url(controller='search', action='index'),{'q':'def+repo'})
 
        print response.body
 
        assert '9 results' in response.body,'no message about proper search results'
 
        

Changeset was too big and was cut off... Show full diff anyway

0 comments (0 inline, 0 general)