allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/2] allura git commit: [#7854] convert HTML entities when extracting pages in the importer
Date Mon, 16 Mar 2015 16:21:47 GMT
[#7854] convert HTML entities when extracting pages in the importer


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5c8f832d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5c8f832d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5c8f832d

Branch: refs/heads/db/7854
Commit: 5c8f832d1e72f95c41352b35d7431cd8edb3fc70
Parents: 8337e6f
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Mon Mar 16 16:21:32 2015 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Mar 16 16:21:32 2015 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/base.py                        | 2 +-
 ForgeImporters/forgeimporters/tests/google/test_extractor.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/5c8f832d/ForgeImporters/forgeimporters/base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/base.py b/ForgeImporters/forgeimporters/base.py
index ae19156..8428142 100644
--- a/ForgeImporters/forgeimporters/base.py
+++ b/ForgeImporters/forgeimporters/base.py
@@ -223,7 +223,7 @@ class ProjectExtractor(object):
         :param page: A file-like object return from :meth:`urlopen`
 
         """
-        return BeautifulSoup(page)
+        return BeautifulSoup(page, convertEntities=BeautifulSoup.HTML_ENTITIES)
 
 
 class ProjectImporter(BaseController):

http://git-wip-us.apache.org/repos/asf/allura/blob/5c8f832d/ForgeImporters/forgeimporters/tests/google/test_extractor.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/test_extractor.py b/ForgeImporters/forgeimporters/tests/google/test_extractor.py
index 228fa0b..60ca0e2 100644
--- a/ForgeImporters/forgeimporters/tests/google/test_extractor.py
+++ b/ForgeImporters/forgeimporters/tests/google/test_extractor.py
@@ -56,7 +56,7 @@ class TestGoogleCodeProjectExtractor(TestCase):
 
         self.urlopen.assert_called_once_with(
             'http://code.google.com/p/my-project/')
-        self.soup.assert_called_once_with(self.urlopen.return_value)
+        self.soup.assert_called_once_with(self.urlopen.return_value, convertEntities=self.soup.HTML_ENTITIES)
         self.assertEqual(extractor.page, self.soup.return_value)
 
     def test_get_page(self):


Mime
View raw message