summaryrefslogtreecommitdiff
path: root/pelican/tests/test_importer.py
diff options
context:
space:
mode:
Diffstat (limited to 'pelican/tests/test_importer.py')
-rw-r--r--pelican/tests/test_importer.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/pelican/tests/test_importer.py b/pelican/tests/test_importer.py
index f7346b9a..709086c0 100644
--- a/pelican/tests/test_importer.py
+++ b/pelican/tests/test_importer.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import locale
import os
import re
@@ -41,7 +39,7 @@ class TestBloggerXmlImporter(unittest.TestCase):
def setUp(self):
self.old_locale = locale.setlocale(locale.LC_ALL)
- locale.setlocale(locale.LC_ALL, str('C'))
+ locale.setlocale(locale.LC_ALL, 'C')
self.posts = blogger2fields(BLOGGER_XML_SAMPLE)
def tearDown(self):
@@ -90,7 +88,7 @@ class TestWordpressXmlImporter(unittest.TestCase):
def setUp(self):
self.old_locale = locale.setlocale(locale.LC_ALL)
- locale.setlocale(locale.LC_ALL, str('C'))
+ locale.setlocale(locale.LC_ALL, 'C')
self.posts = wp2fields(WORDPRESS_XML_SAMPLE)
self.custposts = wp2fields(WORDPRESS_XML_SAMPLE, True)
@@ -282,9 +280,9 @@ class TestWordpressXmlImporter(unittest.TestCase):
def test_decode_wp_content(self):
""" Check that we can decode a wordpress content string."""
- with open(WORDPRESS_ENCODED_CONTENT_SAMPLE, 'r') as encoded_file:
+ with open(WORDPRESS_ENCODED_CONTENT_SAMPLE) as encoded_file:
encoded_content = encoded_file.read()
- with open(WORDPRESS_DECODED_CONTENT_SAMPLE, 'r') as decoded_file:
+ with open(WORDPRESS_DECODED_CONTENT_SAMPLE) as decoded_file:
decoded_content = decoded_file.read()
self.assertEqual(
decode_wp_content(encoded_content, br=False),
@@ -405,7 +403,7 @@ class TestBuildHeader(unittest.TestCase):
class TestWordpressXMLAttachements(unittest.TestCase):
def setUp(self):
self.old_locale = locale.setlocale(locale.LC_ALL)
- locale.setlocale(locale.LC_ALL, str('C'))
+ locale.setlocale(locale.LC_ALL, 'C')
self.attachments = get_attachments(WORDPRESS_XML_SAMPLE)
def tearDown(self):