Mercurial > kallithea
diff rhodecode/tests/__init__.py @ 1366:9c0f5d558789 beta
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
to db repository instance, and then fetched from cache. Also made all current test work.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 07 Jun 2011 17:58:51 +0200 |
parents | 15b60f83420c |
children | c310e1e1e757 |
line wrap: on
line diff
--- a/rhodecode/tests/__init__.py Mon Jun 06 17:30:34 2011 +0200 +++ b/rhodecode/tests/__init__.py Tue Jun 07 17:58:51 2011 +0200 @@ -7,6 +7,9 @@ This module initializes the application via ``websetup`` (`paster setup-app`) and provides the base testing objects. """ +import os +from os.path import join as jn + from unittest import TestCase from paste.deploy import loadapp @@ -14,7 +17,7 @@ from pylons import config, url from routes.util import URLGenerator from webtest import TestApp -import os + from rhodecode.model import meta import logging @@ -35,7 +38,7 @@ environ = {} #SOME GLOBALS FOR TESTS -TESTS_TMP_PATH = '/tmp' +TESTS_TMP_PATH = jn('/', 'tmp') HG_REPO = 'vcs_test_hg' GIT_REPO = 'vcs_test_git' @@ -64,8 +67,8 @@ 'password':password}) if 'invalid user name' in response.body: - assert False, 'could not login using %s %s' % (username, password) + self.fail('could not login using %s %s' % (username, password)) - assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status - assert response.session['rhodecode_user'].username == username, 'wrong logged in user got %s expected %s' % (response.session['rhodecode_user'].username, username) + self.assertEqual(response.status, '302 Found') + self.assertEqual(response.session['rhodecode_user'].username, username) return response.follow()