From 92e3066430b1244827035b6167646722bba1fbc9 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sat, 2 May 2015 13:55:04 +0300 Subject: Tests pass --- newsdiff/core/tests/haaretz_tests.py | 6 +++--- 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): -- cgit v1.3.1