From f7bc58a767c80495ca46bd05a8b2f04aeaae462e Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Thu, 25 Apr 2013 12:03:44 +0000 Subject: [PATCH] Added assertIn / assertNotIn for python 2.6 --- .travis.yml | 6 ------ tests/test_django.py | 8 +++++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5fe62ea..e78bda5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,12 +12,6 @@ env: - PYMONGO=2.5 DJANGO=1.5.1 - PYMONGO=2.5 DJANGO=1.4.2 - PYMONGO=2.4.2 DJANGO=1.4.2 -matrix: - exclude: - - python: "2.6" - env: PYMONGO=dev DJANGO=1.5.1 - - python: "2.6" - env: PYMONGO=2.5 DJANGO=1.5.1 install: - if [[ $TRAVIS_PYTHON_VERSION == '2.'* ]]; then cp /usr/lib/*/libz.so $VIRTUAL_ENV/lib/; fi - if [[ $TRAVIS_PYTHON_VERSION == '2.'* ]]; then pip install pil --use-mirrors ; true; fi diff --git a/tests/test_django.py b/tests/test_django.py index 01a105a3..573c0728 100644 --- a/tests/test_django.py +++ b/tests/test_django.py @@ -178,6 +178,12 @@ class MongoDBSessionTest(SessionTestsMixin, unittest.TestCase): MongoSession.drop_collection() super(MongoDBSessionTest, self).setUp() + def assertIn(self, first, second, msg=None): + self.assertTrue(first in second, msg) + + def assertNotIn(self, first, second, msg=None): + self.assertFalse(first in second, msg) + def test_first_save(self): session = SessionStore() session['test'] = True @@ -188,7 +194,7 @@ class MongoDBSessionTest(SessionTestsMixin, unittest.TestCase): activate_timezone(FixedOffset(60, 'UTC+1')) # create and save new session session = SessionStore() - session.set_expiry(600) # expire in 600 seconds + session.set_expiry(600) # expire in 600 seconds session['test_expire'] = True session.save() # reload session with key