From 9657071301ffb7029d17a675f9544e7ec458b202 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 6 Oct 2013 15:30:14 +0200 Subject: [PATCH 1/2] Python 3.3 got mock --- pelican/tests/test_generators.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index f47ce7d3..e821bb86 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -3,7 +3,10 @@ from __future__ import unicode_literals import os from codecs import open -from mock import MagicMock +try: + from unittest.mock import MagicMock +except ImportError: + from mock import MagicMock from shutil import rmtree from tempfile import mkdtemp From 67d3ab8883ba072cc10da214db25dceedb0000a1 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 6 Oct 2013 16:15:43 +0200 Subject: [PATCH 2/2] assertEquals is deprecated in favor of assertEqual --- pelican/tests/test_contents.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 437d0228..9c894ffc 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -193,17 +193,17 @@ class TestPage(unittest.TestCase): 'link') page = Page(**args) content = page.get_content('http://notmyidea.org') - self.assertEquals(content, ('A simple test, with a ' - 'link')) + self.assertEqual(content, ('A simple test, with a ' + 'link')) # Category args['content'] = ('A simple test, with a ' 'link') page = Page(**args) content = page.get_content('http://notmyidea.org') - self.assertEquals(content, - ('A simple test, with a ' - 'link')) + self.assertEqual(content, + ('A simple test, with a ' + 'link')) def test_intrasite_link(self): # type does not take unicode in PY2 and bytes in PY3, which in @@ -222,7 +222,7 @@ class TestPage(unittest.TestCase): 'link' ) content = Page(**args).get_content('http://notmyidea.org') - self.assertEquals( + self.assertEqual( content, 'A simple test, with a ' 'link' @@ -234,7 +234,7 @@ class TestPage(unittest.TestCase): 'link' ) content = Page(**args).get_content('http://notmyidea.org') - self.assertEquals( + self.assertEqual( content, 'A simple test, with a ' 'link' @@ -247,7 +247,7 @@ class TestPage(unittest.TestCase): '?utm_whatever=234&highlight=word">link' ) content = Page(**args).get_content('http://notmyidea.org') - self.assertEquals( + self.assertEqual( content, 'A simple test, with a ' 'link' ) content = Page(**args).get_content('http://notmyidea.org') - self.assertEquals( + self.assertEqual( content, 'A simple test, with a ' '