aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/tests/__init__.py
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2011-11-23 00:55:05 +0200
committerMarcin Kuzminski <marcin@python-works.com>2011-11-23 00:55:05 +0200
commit316164a9dde9a32b4d66fc537e98a9d2339cd95f (patch)
treefdb0df88d80244236b8105fd2fed21e583c5865a /rhodecode/tests/__init__.py
parentfc5c80f0d429d09d266e123507cc0afbaa3ff7a3 (diff)
Notification system improvements
- deleting - tests - ui - moved to separate controller --HG-- branch : beta rename : rhodecode/templates/admin/users/notifications.html => rhodecode/templates/admin/notifications/notifications.html
Diffstat (limited to 'rhodecode/tests/__init__.py')
-rw-r--r--rhodecode/tests/__init__.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/rhodecode/tests/__init__.py b/rhodecode/tests/__init__.py
index cb892fc1..dcea5c7d 100644
--- a/rhodecode/tests/__init__.py
+++ b/rhodecode/tests/__init__.py
@@ -9,6 +9,7 @@ setup-app`) and provides the base testing objects.
"""
import os
import time
+import logging
from os.path import join as jn
from unittest import TestCase
@@ -20,7 +21,8 @@ from routes.util import URLGenerator
from webtest import TestApp
from rhodecode.model import meta
-import logging
+from rhodecode.model.db import User
+
import pylons.test
os.environ['TZ'] = 'UTC'
@@ -68,10 +70,11 @@ class TestController(TestCase):
def log_user(self, username=TEST_USER_ADMIN_LOGIN,
password=TEST_USER_ADMIN_PASS):
+ self._logged_username = username
response = self.app.post(url(controller='login', action='index'),
{'username':username,
'password':password})
-
+
if 'invalid user name' in response.body:
self.fail('could not login using %s %s' % (username, password))
@@ -79,6 +82,10 @@ class TestController(TestCase):
self.assertEqual(response.session['rhodecode_user'].username, username)
return response.follow()
+ def _get_logged_user(self):
+ return User.get_by_username(self._logged_username)
+
+
def checkSessionFlash(self, response, msg):
self.assertTrue('flash' in response.session)
self.assertTrue(msg in response.session['flash'][0][1])