From 8f73c552a96cc54e6abefcfc0c4e9d4cdd7dc040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuha=CC=88user?= Date: Wed, 22 May 2013 20:53:32 +0200 Subject: [PATCH] Add missing assertIn, assertNotIn methods on 2.6 --- flask/testsuite/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flask/testsuite/__init__.py b/flask/testsuite/__init__.py index 88cd4d88..89b8cec1 100644 --- a/flask/testsuite/__init__.py +++ b/flask/testsuite/__init__.py @@ -154,6 +154,13 @@ class FlaskTestCase(unittest.TestCase): def assert_not_in(self, x, y): self.assertNotIn(x, y) + if sys.version_info[:2] == (2, 6): + def assertIn(self, x, y): + assert x in y, "%r unexpectedly not in %r" % (x, y) + + def assertNotIn(self, x, y): + assert x not in y, "%r unexpectedly in %r" % (x, y) + class _ExceptionCatcher(object):