Show More
@@ -32,6 +32,10 b' from rhodecode import __py_version__, is' | |||||
32 | #============================================================================== |
|
32 | #============================================================================== | |
33 | from rhodecode.lib.ext_json import json |
|
33 | from rhodecode.lib.ext_json import json | |
34 |
|
34 | |||
|
35 | if __py_version__ >= (2, 7): | |||
|
36 | import unittest | |||
|
37 | else: | |||
|
38 | import unittest2 as unittest | |||
35 |
|
39 | |||
36 | #============================================================================== |
|
40 | #============================================================================== | |
37 | # izip_longest |
|
41 | # izip_longest |
@@ -25,7 +25,6 b' import hashlib' | |||||
25 | import tempfile |
|
25 | import tempfile | |
26 | from os.path import join as jn |
|
26 | from os.path import join as jn | |
27 |
|
27 | |||
28 | from unittest import TestCase |
|
|||
29 | from tempfile import _RandomNameSequence |
|
28 | from tempfile import _RandomNameSequence | |
30 |
|
29 | |||
31 | from paste.deploy import loadapp |
|
30 | from paste.deploy import loadapp | |
@@ -41,6 +40,7 b' from routes.util import URLGenerator' | |||||
41 | from webtest import TestApp |
|
40 | from webtest import TestApp | |
42 | from nose.plugins.skip import SkipTest |
|
41 | from nose.plugins.skip import SkipTest | |
43 |
|
42 | |||
|
43 | from rhodecode.lib.compat import unittest | |||
44 | from rhodecode import is_windows |
|
44 | from rhodecode import is_windows | |
45 | from rhodecode.model.meta import Session |
|
45 | from rhodecode.model.meta import Session | |
46 | from rhodecode.model.db import User |
|
46 | from rhodecode.model.db import User | |
@@ -157,11 +157,11 b' def init_stack(config=None):' | |||||
157 | pylons.translator._push_object(translator) |
|
157 | pylons.translator._push_object(translator) | |
158 |
|
158 | |||
159 |
|
159 | |||
160 | class BaseTestCase(TestCase): |
|
160 | class BaseTestCase(unittest.TestCase): | |
161 | def __init__(self, *args, **kwargs): |
|
161 | def __init__(self, *args, **kwargs): | |
162 | self.wsgiapp = pylons.test.pylonsapp |
|
162 | self.wsgiapp = pylons.test.pylonsapp | |
163 | init_stack(self.wsgiapp.config) |
|
163 | init_stack(self.wsgiapp.config) | |
164 | TestCase.__init__(self, *args, **kwargs) |
|
164 | unittest.TestCase.__init__(self, *args, **kwargs) | |
165 |
|
165 | |||
166 |
|
166 | |||
167 | class TestController(BaseTestCase): |
|
167 | class TestController(BaseTestCase): |
General Comments 0
You need to be logged in to leave comments.
Login now