Commits

Mikhail Korobov  committed 8a9956a

Testing fixes: assertRaises doesn't work properly in Python 2.6+django1.2; add dj12-py26 config to tox.ini; add Travis badge; exclude pypy + django1.5 from travis

  • Participants
  • Parent commits 9c9798d

Comments (0)

Files changed (4)

           env: DJANGO_VERSION=1.2.7
         - python: "pypy"
           env: DJANGO_VERSION=1.3.7
+        # pypy 1.9 is known not to work with django 1.5, see
+        # https://code.djangoproject.com/ticket/19944
+        - python: "pypy"
+          env: DJANGO_VERSION=1.5
 
 
 # command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
 django-webtest
 ==============
 
+.. image:: https://travis-ci.org/kmike/django-webtest.png?branch=master
+    :target: https://travis-ci.org/kmike/django-webtest
+
 django-webtest is an app for instant integration of Ian Bicking's
 WebTest (http://webtest.pythonpaste.org/) with django's
 testing framework.

File django_webtest_tests/testapp_tests/tests.py

         self.assertEqual(response['content-type'], 'text/html; charset=utf-8')
 
     def test_bad_header(self):
-        response = self.app.get('/')
-        with self.assertRaises(KeyError):
+        def access_bad_header():
+            response = self.app.get('/')
             response['X-Unknown-Header']
+        self.assertRaises(KeyError, access_bad_header)
 
 [tox]
 envlist =
     py26,py27,pypy,
+    dj12-py26,
     dj12,dj13,dj14,dj15,
     dj15-py32,dj15-py33,dj15-py33-postgres,
     py26-wt1x, py32-wt2x
 deps=
     django == 1.5
 
+[testenv:dj12-py26]
+basepython = python2.6
+deps=
+    WebTest
+    django == 1.2.7
+
 [testenv:dj15]
 deps=
     WebTest