Skip to content

Commit e8e7e89

Browse files
Fix Python 2.6 support, update requirements.
1 parent d86badc commit e8e7e89

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

learnpython/tests/common.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
from flask import url_for
2-
from flask.ext.testing import JsonResponseMixin, TestCase as BaseTestCase, \
2+
from flask.ext.testing import JsonResponseMixin, TestCase as FlaskTestCase, \
33
Twill as BaseTwill
44
from twill import commands
55
from webtest import TestApp
66

77
from learnpython.app import app, mail
88

9+
if not hasattr(FlaskTestCase, 'assertIn'):
10+
from unittest2 import TestCase
11+
BaseTestCase = type('BaseTestCase', (FlaskTestCase, TestCase), {})
12+
else:
13+
BaseTestCase = FlaskTestCase
14+
915

1016
__all__ = ('TEST_COMMENTS', 'TEST_EMAIL', 'TEST_MESSAGE', 'TEST_NAME',
11-
'TEST_PHONE', 'TEST_SUBJECT', 'Mechanize', 'TestCase', 'Twill')
17+
'TEST_PHONE', 'TEST_SUBJECT', 'TestCase', 'Twill')
1218

1319

1420
TEST_COMMENTS = 'Test additional comments.'

requirements.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
Babel==0.9.6
2-
blinker==1.2
3-
docutils==0.9.1
42
Flask==0.9
53
Flask-Babel==0.8
64
Flask-FlatPages==0.3
75
Flask-LazyViews==0.3
86
Flask-Mail==0.7.2
7+
Flask-Script==0.5.1
98
Flask-Testing==0.4
109
Flask-WTF==0.8
11-
gunicorn==0.14.6
10+
WTForms==1.0.2
11+
WebTest==1.4.0
12+
blinker==1.2
13+
docutils==0.9.1
14+
gunicorn==0.15.0
1215
lxml==2.3.5
1316
nose==1.2.1
1417
ordereddict==1.1
1518
pyquery==1.2.1
1619
selenium==2.25.0
1720
splinter==0.4.8
1821
twill==0.9
19-
WebTest==1.4.0
22+
unittest2==0.5.1
2023
windmill==1.6
21-
WTForms==1.0.2
22-
23-
https://github.com/techniq/flask-script/tarball/master#egg=Flask-Script

0 commit comments

Comments
 (0)