diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-05-02 13:55:04 +0300 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-05-02 13:55:04 +0300 |
| commit | 92e3066430b1244827035b6167646722bba1fbc9 (patch) | |
| tree | 3c98f3889dffbfa4e56fc72957873fb857b7f976 | |
| parent | fbbf4cbc34d9095f58d9c85bf9152c10f1dcc38a (diff) | |
Tests pass
| -rw-r--r-- | newsdiff/core/tests/haaretz_tests.py | 6 | ||||
| -rw-r--r-- | newsdiff/core/utils.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/newsdiff/core/tests/haaretz_tests.py b/newsdiff/core/tests/haaretz_tests.py index 3c26e35..cceb050 100644 --- a/newsdiff/core/tests/haaretz_tests.py +++ b/newsdiff/core/tests/haaretz_tests.py @@ -1,19 +1,19 @@ from bs4 import BeautifulSoup from django.test import TestCase -from unipath import FSPath as Path +from pathlib import Path from newsdiff.core.parsers.haaretz import HaaretzParser from ..models import HaaretzArticle, HaaretzImage class HaaretzParsingTestCase(TestCase): - CONTENT_DIR = Path(__file__).absolute().parent.child('content') + CONTENT_DIR = str(Path(__file__).resolve().parents[1] / 'content') def setUp(self): self.parser = HaaretzParser() def _get_content(self, filename): - with open(self.CONTENT_DIR.child(filename), 'r') as f: + with open(str(self.CONTENT_DIR / filename), 'r') as f: return f.read() def _get_soup(self, filename): diff --git a/newsdiff/core/utils.py b/newsdiff/core/utils.py index d104a81..da93673 100644 --- a/newsdiff/core/utils.py +++ b/newsdiff/core/utils.py @@ -3,7 +3,7 @@ import requests from django.core.files import File from django.core.files.temp import NamedTemporaryFile -from urlparse import urlparse +from urllib.parse import urlparse def get_file_from_url(url): |
