Update isort & rerun formatting
This commit is contained in:
parent
ed658c4dfd
commit
982c5bb132
51 changed files with 1993 additions and 1926 deletions
|
|
@ -2,6 +2,11 @@
|
|||
include_trailing_comma = true
|
||||
line_length = 80
|
||||
multi_line_output = 3
|
||||
skip = env/
|
||||
forced_separate=django, newsreader
|
||||
skip = env/, venv/
|
||||
default_section = THIRDPARTY
|
||||
known_first_party = newsreader
|
||||
known_django = django
|
||||
sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
|
||||
lines_between_types=1
|
||||
lines_after_imports=2
|
||||
lines_between_types=1
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/2.2/ref/settings/
|
|||
|
||||
import os
|
||||
|
||||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
|
@ -62,9 +63,9 @@ TEMPLATES = [
|
|||
"django.template.context_processors.request",
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
],
|
||||
},
|
||||
]
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
WSGI_APPLICATION = "newsreader.wsgi.application"
|
||||
|
|
@ -82,19 +83,10 @@ DATABASES = {
|
|||
# Password validation
|
||||
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{
|
||||
"NAME":
|
||||
"django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
||||
},
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
||||
},
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
||||
},
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
||||
},
|
||||
{"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"},
|
||||
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
|
||||
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
|
||||
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
|
||||
]
|
||||
|
||||
# Internationalization
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from .base import *
|
||||
|
||||
|
||||
# Development settings
|
||||
|
||||
DEBUG = True
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from django.contrib import admin
|
||||
|
||||
|
||||
# Register your models here.
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@ from django.apps import AppConfig
|
|||
|
||||
|
||||
class CoreConfig(AppConfig):
|
||||
name = 'core'
|
||||
name = "core"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ class TimeStampedModel(models.Model):
|
|||
An abstract base class model that provides self-
|
||||
updating ``created`` and ``modified`` fields.
|
||||
"""
|
||||
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
modified = models.DateTimeField(auto_now=True)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from django.test import TestCase
|
||||
|
||||
|
||||
# Create your tests here.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
|
||||
# Create your views here.
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@ from django.apps import AppConfig
|
|||
|
||||
|
||||
class CollectionConfig(AppConfig):
|
||||
name = 'collection'
|
||||
name = "collection"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
from typing import ContextManager, Dict, List, Optional, Tuple
|
||||
|
||||
from django.utils import timezone
|
||||
|
||||
import requests
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from django.utils import timezone
|
||||
|
||||
from newsreader.news.collection.exceptions import StreamParseException
|
||||
from newsreader.news.collection.models import CollectionRule
|
||||
from newsreader.news.collection.utils import fetch
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ from newsreader.news.collection.base import (
|
|||
from newsreader.news.collection.exceptions import StreamException
|
||||
from newsreader.news.collection.feed import FeedClient
|
||||
|
||||
|
||||
LINK_RELS = ["icon", "shortcut icon", "apple-touch-icon", "apple-touch-icon-precomposed"]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
from typing import ContextManager, Dict, Generator, List, Optional, Tuple
|
||||
|
||||
from django.utils import timezone
|
||||
|
||||
import bleach
|
||||
import pytz
|
||||
|
||||
from feedparser import parse
|
||||
|
||||
from django.utils import timezone
|
||||
|
||||
from newsreader.news.collection.base import Builder, Client, Collector, Stream
|
||||
from newsreader.news.collection.exceptions import (
|
||||
StreamDeniedException,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from newsreader.news.collection.models import CollectionRule
|
|||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Collects Atom/RSS feeds'
|
||||
help = "Collects Atom/RSS feeds"
|
||||
|
||||
def handle(self, *args, **options):
|
||||
CollectionRule.objects.all()
|
||||
|
|
|
|||
|
|
@ -11,21 +11,18 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='CollectionRule',
|
||||
name="CollectionRule",
|
||||
fields=[
|
||||
(
|
||||
'id',
|
||||
"id",
|
||||
models.AutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name='ID'
|
||||
)
|
||||
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
|
||||
),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('url', models.URLField()),
|
||||
('last_suceeded', models.DateTimeField()),
|
||||
('succeeded', models.BooleanField(default=False)),
|
||||
),
|
||||
("name", models.CharField(max_length=100)),
|
||||
("url", models.URLField()),
|
||||
("last_suceeded", models.DateTimeField()),
|
||||
("succeeded", models.BooleanField(default=False)),
|
||||
],
|
||||
),
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -5,14 +5,12 @@ from django.db import migrations, models
|
|||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('collection', '0001_initial'),
|
||||
]
|
||||
dependencies = [("collection", "0001_initial")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='collectionrule',
|
||||
name='last_suceeded',
|
||||
model_name="collectionrule",
|
||||
name="last_suceeded",
|
||||
field=models.DateTimeField(blank=True, null=True),
|
||||
),
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -7,22 +7,19 @@ from django.db import migrations, models
|
|||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('posts', '0002_auto_20190520_2206'),
|
||||
('collection', '0002_auto_20190410_2028'),
|
||||
]
|
||||
dependencies = [("posts", "0002_auto_20190520_2206"), ("collection", "0002_auto_20190410_2028")]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='collectionrule',
|
||||
name='category',
|
||||
model_name="collectionrule",
|
||||
name="category",
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
help_text='Posts from this rule will be tagged with this category',
|
||||
help_text="Posts from this rule will be tagged with this category",
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
to='posts.Category',
|
||||
verbose_name='Category'
|
||||
),
|
||||
to="posts.Category",
|
||||
verbose_name="Category",
|
||||
),
|
||||
)
|
||||
]
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -5,20 +5,18 @@ from django.db import migrations, models
|
|||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('collection', '0004_collectionrule_timezone'),
|
||||
]
|
||||
dependencies = [("collection", "0004_collectionrule_timezone")]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='collectionrule',
|
||||
name='favicon',
|
||||
field=models.ImageField(blank=True, null=True, upload_to=''),
|
||||
model_name="collectionrule",
|
||||
name="favicon",
|
||||
field=models.ImageField(blank=True, null=True, upload_to=""),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='collectionrule',
|
||||
name='source',
|
||||
field=models.CharField(default='source', max_length=100),
|
||||
model_name="collectionrule",
|
||||
name="source",
|
||||
field=models.CharField(default="source", max_length=100),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -5,14 +5,12 @@ from django.db import migrations, models
|
|||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('collection', '0005_auto_20190521_1941'),
|
||||
]
|
||||
dependencies = [("collection", "0005_auto_20190521_1941")]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='collectionrule',
|
||||
name='error',
|
||||
model_name="collectionrule",
|
||||
name="error",
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import pytz
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
import pytz
|
||||
|
||||
|
||||
class CollectionRule(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
simple_mock = BeautifulSoup(
|
||||
"""
|
||||
<html>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from freezegun import freeze_time
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from freezegun import freeze_time
|
||||
|
||||
from newsreader.news.collection.favicon import FaviconBuilder
|
||||
from newsreader.news.collection.tests.factories import CollectionRuleFactory
|
||||
from newsreader.news.collection.tests.favicon.builder.mocks import *
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
simple_mock = BeautifulSoup(
|
||||
"""
|
||||
<html>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from time import struct_time
|
|||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
feed_mock = {
|
||||
"bozo": 0,
|
||||
"encoding": "utf-8",
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from django.test import TestCase
|
||||
from django.utils import timezone
|
||||
|
||||
import pytz
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from .mocks import feed_mock, website_mock
|
||||
|
||||
from django.test import TestCase
|
||||
from django.utils import timezone
|
||||
|
||||
from newsreader.news.collection.exceptions import (
|
||||
StreamDeniedException,
|
||||
StreamException,
|
||||
|
|
@ -20,6 +18,8 @@ from newsreader.news.collection.exceptions import (
|
|||
from newsreader.news.collection.favicon import FaviconCollector
|
||||
from newsreader.news.collection.tests.factories import CollectionRuleFactory
|
||||
|
||||
from .mocks import feed_mock, website_mock
|
||||
|
||||
|
||||
class FaviconCollectorTestCase(TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
html_summary = '''
|
||||
html_summary = """
|
||||
<html>
|
||||
<body>
|
||||
<article>
|
||||
|
|
@ -7,4 +7,4 @@ html_summary = '''
|
|||
</article>
|
||||
</body>
|
||||
</html>
|
||||
'''
|
||||
"""
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,20 +1,20 @@
|
|||
from datetime import date, datetime, time
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from django.test import TestCase
|
||||
from django.utils import timezone
|
||||
|
||||
import pytz
|
||||
|
||||
from freezegun import freeze_time
|
||||
|
||||
from .mocks import *
|
||||
|
||||
from django.test import TestCase
|
||||
from django.utils import timezone
|
||||
|
||||
from newsreader.news.collection.feed import FeedBuilder
|
||||
from newsreader.news.collection.tests.factories import CollectionRuleFactory
|
||||
from newsreader.news.posts.models import Post
|
||||
from newsreader.news.posts.tests.factories import PostFactory
|
||||
|
||||
from .mocks import *
|
||||
|
||||
|
||||
class FeedBuilderTestCase(TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
|||
|
|
@ -1,61 +1,63 @@
|
|||
from time import struct_time
|
||||
|
||||
|
||||
simple_mock = {
|
||||
'bozo': 0,
|
||||
'encoding': 'utf-8',
|
||||
'entries': [{
|
||||
'guidislink': False,
|
||||
'href': '',
|
||||
'id': 'https://www.bbc.co.uk/news/world-us-canada-48338168',
|
||||
'link': 'https://www.bbc.co.uk/news/world-us-canada-48338168',
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/world-us-canada-48338168',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'media_thumbnail': [{
|
||||
'height': '1152',
|
||||
'url': 'http://c.files.bbci.co.uk/7605/production/_107031203_mediaitem107031202.jpg',
|
||||
'width': '2048'
|
||||
}],
|
||||
'published': 'Mon, 20 May 2019 16:07:37 GMT',
|
||||
'published_parsed': struct_time((2019, 5, 20, 16, 7, 37, 0, 140, 0)),
|
||||
'summary': 'Foreign Minister Mohammad Javad Zarif says the US '
|
||||
'president should try showing Iranians some respect.',
|
||||
'summary_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/html',
|
||||
'value': 'Foreign Minister Mohammad Javad '
|
||||
'Zarif says the US president should '
|
||||
'try showing Iranians some '
|
||||
'respect.'
|
||||
},
|
||||
'title': "Trump's 'genocidal taunts' will not end Iran - Zarif",
|
||||
'title_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/plain',
|
||||
'value': "Trump's 'genocidal taunts' will not "
|
||||
'end Iran - Zarif'
|
||||
"bozo": 0,
|
||||
"encoding": "utf-8",
|
||||
"entries": [
|
||||
{
|
||||
"guidislink": False,
|
||||
"href": "",
|
||||
"id": "https://www.bbc.co.uk/news/world-us-canada-48338168",
|
||||
"link": "https://www.bbc.co.uk/news/world-us-canada-48338168",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://www.bbc.co.uk/news/world-us-canada-48338168",
|
||||
"rel": "alternate",
|
||||
"type": "text/html",
|
||||
}
|
||||
}],
|
||||
'feed': {
|
||||
'image': {
|
||||
'href': 'https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif',
|
||||
'link': 'https://www.bbc.co.uk/news/',
|
||||
'title': 'BBC News - Home',
|
||||
'language': 'en-gb',
|
||||
'link': 'https://www.bbc.co.uk/news/'
|
||||
},
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'title': 'BBC News - Home',
|
||||
},
|
||||
'href': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'status': 200,
|
||||
'version': 'rss20'
|
||||
],
|
||||
"media_thumbnail": [
|
||||
{
|
||||
"height": "1152",
|
||||
"url": "http://c.files.bbci.co.uk/7605/production/_107031203_mediaitem107031202.jpg",
|
||||
"width": "2048",
|
||||
}
|
||||
],
|
||||
"published": "Mon, 20 May 2019 16:07:37 GMT",
|
||||
"published_parsed": struct_time((2019, 5, 20, 16, 7, 37, 0, 140, 0)),
|
||||
"summary": "Foreign Minister Mohammad Javad Zarif says the US "
|
||||
"president should try showing Iranians some respect.",
|
||||
"summary_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/html",
|
||||
"value": "Foreign Minister Mohammad Javad "
|
||||
"Zarif says the US president should "
|
||||
"try showing Iranians some "
|
||||
"respect.",
|
||||
},
|
||||
"title": "Trump's 'genocidal taunts' will not end Iran - Zarif",
|
||||
"title_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/plain",
|
||||
"value": "Trump's 'genocidal taunts' will not " "end Iran - Zarif",
|
||||
},
|
||||
}
|
||||
],
|
||||
"feed": {
|
||||
"image": {
|
||||
"href": "https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif",
|
||||
"link": "https://www.bbc.co.uk/news/",
|
||||
"title": "BBC News - Home",
|
||||
"language": "en-gb",
|
||||
"link": "https://www.bbc.co.uk/news/",
|
||||
},
|
||||
"links": [{"href": "https://www.bbc.co.uk/news/", "rel": "alternate", "type": "text/html"}],
|
||||
"title": "BBC News - Home",
|
||||
},
|
||||
"href": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"status": 200,
|
||||
"version": "rss20",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from .mocks import simple_mock
|
||||
|
||||
from django.test import TestCase
|
||||
from django.utils import timezone
|
||||
|
||||
|
|
@ -15,6 +13,8 @@ from newsreader.news.collection.exceptions import (
|
|||
from newsreader.news.collection.feed import FeedClient
|
||||
from newsreader.news.collection.tests.factories import CollectionRuleFactory
|
||||
|
||||
from .mocks import simple_mock
|
||||
|
||||
|
||||
class FeedClientTestCase(TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
|||
|
|
@ -1,430 +1,442 @@
|
|||
from time import struct_time
|
||||
|
||||
|
||||
multiple_mock = {
|
||||
'bozo': 0,
|
||||
'encoding': 'utf-8',
|
||||
'entries': [
|
||||
"bozo": 0,
|
||||
"encoding": "utf-8",
|
||||
"entries": [
|
||||
{
|
||||
'guidislink': False,
|
||||
'href': '',
|
||||
'id': 'https://www.bbc.co.uk/news/world-us-canada-48338168',
|
||||
'link': 'https://www.bbc.co.uk/news/world-us-canada-48338168',
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/world-us-canada-48338168',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'media_thumbnail': [{
|
||||
'height': '1152',
|
||||
'url': 'http://c.files.bbci.co.uk/7605/production/_107031203_mediaitem107031202.jpg',
|
||||
'width': '2048'
|
||||
}],
|
||||
'published': 'Mon, 20 May 2019 16:07:37 GMT',
|
||||
'published_parsed': struct_time((2019, 5, 20, 16, 7, 37, 0, 140, 0)),
|
||||
'summary': 'Foreign Minister Mohammad Javad Zarif says the US '
|
||||
'president should try showing Iranians some respect.',
|
||||
'summary_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/html',
|
||||
'value': 'Foreign Minister Mohammad Javad '
|
||||
'Zarif says the US president should '
|
||||
'try showing Iranians some '
|
||||
'respect.'
|
||||
},
|
||||
'title': "Trump's 'genocidal taunts' will not end Iran - Zarif",
|
||||
'title_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/plain',
|
||||
'value': "Trump's 'genocidal taunts' will not "
|
||||
'end Iran - Zarif'
|
||||
"guidislink": False,
|
||||
"href": "",
|
||||
"id": "https://www.bbc.co.uk/news/world-us-canada-48338168",
|
||||
"link": "https://www.bbc.co.uk/news/world-us-canada-48338168",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://www.bbc.co.uk/news/world-us-canada-48338168",
|
||||
"rel": "alternate",
|
||||
"type": "text/html",
|
||||
}
|
||||
},
|
||||
],
|
||||
"media_thumbnail": [
|
||||
{
|
||||
'guidislink': False,
|
||||
'href': '',
|
||||
'id': 'https://www.bbc.co.uk/news/technology-48334739',
|
||||
'link': 'https://www.bbc.co.uk/news/technology-48334739',
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/technology-48334739',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'media_thumbnail': [{
|
||||
'height': '432',
|
||||
'url': 'http://c.files.bbci.co.uk/4789/production/_107031381_mediaitem107028670.jpg',
|
||||
'width': '768'
|
||||
}],
|
||||
'published': 'Mon, 20 May 2019 12:19:19 GMT',
|
||||
'published_parsed': struct_time((2019, 5, 20, 12, 19, 19, 0, 140, 0,)),
|
||||
'summary': "Google's move to end business ties with Huawei will "
|
||||
'affect current devices and future purchases.',
|
||||
'summary_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/html',
|
||||
'value': "Google's move to end business ties "
|
||||
'with Huawei will affect current '
|
||||
'devices and future purchases.'
|
||||
},
|
||||
'title': "Huawei's Android loss: How it affects you",
|
||||
'title_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/plain',
|
||||
'value': "Huawei's Android loss: How it "
|
||||
'affects you'
|
||||
"height": "1152",
|
||||
"url": "http://c.files.bbci.co.uk/7605/production/_107031203_mediaitem107031202.jpg",
|
||||
"width": "2048",
|
||||
}
|
||||
],
|
||||
"published": "Mon, 20 May 2019 16:07:37 GMT",
|
||||
"published_parsed": struct_time((2019, 5, 20, 16, 7, 37, 0, 140, 0)),
|
||||
"summary": "Foreign Minister Mohammad Javad Zarif says the US "
|
||||
"president should try showing Iranians some respect.",
|
||||
"summary_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/html",
|
||||
"value": "Foreign Minister Mohammad Javad "
|
||||
"Zarif says the US president should "
|
||||
"try showing Iranians some "
|
||||
"respect.",
|
||||
},
|
||||
"title": "Trump's 'genocidal taunts' will not end Iran - Zarif",
|
||||
"title_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/plain",
|
||||
"value": "Trump's 'genocidal taunts' will not " "end Iran - Zarif",
|
||||
},
|
||||
},
|
||||
{
|
||||
'guidislink': False,
|
||||
'href': '',
|
||||
'id': 'https://www.bbc.co.uk/news/uk-england-birmingham-48339080',
|
||||
'link': 'https://www.bbc.co.uk/news/uk-england-birmingham-48339080',
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/uk-england-birmingham-48339080',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'media_thumbnail': [{
|
||||
'height': '549',
|
||||
'url': 'http://c.files.bbci.co.uk/11D67/production/_107036037_lgbtheadjpg.jpg',
|
||||
'width': '976'
|
||||
}],
|
||||
'published': 'Mon, 20 May 2019 16:32:38 GMT',
|
||||
'published_parsed': struct_time((2019, 5, 20, 16, 32, 38, 0, 140, 0)),
|
||||
'summary': 'Police are investigating the messages while an MP '
|
||||
"guidislink": False,
|
||||
"href": "",
|
||||
"id": "https://www.bbc.co.uk/news/technology-48334739",
|
||||
"link": "https://www.bbc.co.uk/news/technology-48334739",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://www.bbc.co.uk/news/technology-48334739",
|
||||
"rel": "alternate",
|
||||
"type": "text/html",
|
||||
}
|
||||
],
|
||||
"media_thumbnail": [
|
||||
{
|
||||
"height": "432",
|
||||
"url": "http://c.files.bbci.co.uk/4789/production/_107031381_mediaitem107028670.jpg",
|
||||
"width": "768",
|
||||
}
|
||||
],
|
||||
"published": "Mon, 20 May 2019 12:19:19 GMT",
|
||||
"published_parsed": struct_time((2019, 5, 20, 12, 19, 19, 0, 140, 0)),
|
||||
"summary": "Google's move to end business ties with Huawei will "
|
||||
"affect current devices and future purchases.",
|
||||
"summary_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/html",
|
||||
"value": "Google's move to end business ties "
|
||||
"with Huawei will affect current "
|
||||
"devices and future purchases.",
|
||||
},
|
||||
"title": "Huawei's Android loss: How it affects you",
|
||||
"title_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/plain",
|
||||
"value": "Huawei's Android loss: How it " "affects you",
|
||||
},
|
||||
},
|
||||
{
|
||||
"guidislink": False,
|
||||
"href": "",
|
||||
"id": "https://www.bbc.co.uk/news/uk-england-birmingham-48339080",
|
||||
"link": "https://www.bbc.co.uk/news/uk-england-birmingham-48339080",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://www.bbc.co.uk/news/uk-england-birmingham-48339080",
|
||||
"rel": "alternate",
|
||||
"type": "text/html",
|
||||
}
|
||||
],
|
||||
"media_thumbnail": [
|
||||
{
|
||||
"height": "549",
|
||||
"url": "http://c.files.bbci.co.uk/11D67/production/_107036037_lgbtheadjpg.jpg",
|
||||
"width": "976",
|
||||
}
|
||||
],
|
||||
"published": "Mon, 20 May 2019 16:32:38 GMT",
|
||||
"published_parsed": struct_time((2019, 5, 20, 16, 32, 38, 0, 140, 0)),
|
||||
"summary": "Police are investigating the messages while an MP "
|
||||
'calls for a protest exclusion zone "to protect '
|
||||
'children".',
|
||||
'summary_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/html',
|
||||
'value': 'Police are investigating the '
|
||||
'messages while an MP calls for a '
|
||||
"summary_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/html",
|
||||
"value": "Police are investigating the "
|
||||
"messages while an MP calls for a "
|
||||
'protest exclusion zone "to protect '
|
||||
'children".'
|
||||
'children".',
|
||||
},
|
||||
"title": "Birmingham head teacher threatened over LGBT lessons",
|
||||
"title_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/plain",
|
||||
"value": "Birmingham head teacher threatened " "over LGBT lessons",
|
||||
},
|
||||
'title': 'Birmingham head teacher threatened over LGBT lessons',
|
||||
'title_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/plain',
|
||||
'value': 'Birmingham head teacher threatened '
|
||||
'over LGBT lessons'
|
||||
}
|
||||
},
|
||||
],
|
||||
'feed': {
|
||||
'image': {
|
||||
'href': 'https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif',
|
||||
'link': 'https://www.bbc.co.uk/news/',
|
||||
'title': 'BBC News - Home',
|
||||
'language': 'en-gb',
|
||||
'link': 'https://www.bbc.co.uk/news/'
|
||||
"feed": {
|
||||
"image": {
|
||||
"href": "https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif",
|
||||
"link": "https://www.bbc.co.uk/news/",
|
||||
"title": "BBC News - Home",
|
||||
"language": "en-gb",
|
||||
"link": "https://www.bbc.co.uk/news/",
|
||||
},
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'title': 'BBC News - Home',
|
||||
"links": [{"href": "https://www.bbc.co.uk/news/", "rel": "alternate", "type": "text/html"}],
|
||||
"title": "BBC News - Home",
|
||||
},
|
||||
'href': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'status': 200,
|
||||
'version': 'rss20'
|
||||
"href": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"status": 200,
|
||||
"version": "rss20",
|
||||
}
|
||||
|
||||
empty_mock = {
|
||||
'bozo': 0,
|
||||
'encoding': 'utf-8',
|
||||
'entries': [],
|
||||
'feed': {
|
||||
'image': {
|
||||
'href': 'https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif',
|
||||
'link': 'https://www.bbc.co.uk/news/',
|
||||
'title': 'BBC News - Home',
|
||||
'language': 'en-gb',
|
||||
'link': 'https://www.bbc.co.uk/news/'
|
||||
"bozo": 0,
|
||||
"encoding": "utf-8",
|
||||
"entries": [],
|
||||
"feed": {
|
||||
"image": {
|
||||
"href": "https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif",
|
||||
"link": "https://www.bbc.co.uk/news/",
|
||||
"title": "BBC News - Home",
|
||||
"language": "en-gb",
|
||||
"link": "https://www.bbc.co.uk/news/",
|
||||
},
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'title': 'BBC News - Home',
|
||||
"links": [{"href": "https://www.bbc.co.uk/news/", "rel": "alternate", "type": "text/html"}],
|
||||
"title": "BBC News - Home",
|
||||
},
|
||||
'href': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'status': 200,
|
||||
'version': 'rss20'
|
||||
"href": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"status": 200,
|
||||
"version": "rss20",
|
||||
}
|
||||
|
||||
duplicate_mock = {
|
||||
'bozo': 0,
|
||||
'encoding': 'utf-8',
|
||||
'entries': [
|
||||
"bozo": 0,
|
||||
"encoding": "utf-8",
|
||||
"entries": [
|
||||
{
|
||||
'guidislink': False,
|
||||
'href': '',
|
||||
'link': 'https://www.bbc.co.uk/news/world-us-canada-48338168',
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/world-us-canada-48338168',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'media_thumbnail': [{
|
||||
'height': '1152',
|
||||
'url': 'http://c.files.bbci.co.uk/7605/production/_107031203_mediaitem107031202.jpg',
|
||||
'width': '2048'
|
||||
}],
|
||||
'published': 'Mon, 20 May 2019 16:07:37 GMT',
|
||||
'published_parsed': struct_time((2019, 5, 20, 16, 7, 37, 0, 140, 0)),
|
||||
'summary': 'Foreign Minister Mohammad Javad Zarif says the US '
|
||||
'president should try showing Iranians some respect.',
|
||||
'summary_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/html',
|
||||
'value': 'Foreign Minister Mohammad Javad '
|
||||
'Zarif says the US president should '
|
||||
'try showing Iranians some '
|
||||
'respect.'
|
||||
},
|
||||
'title': "Trump's 'genocidal taunts' will not end Iran - Zarif",
|
||||
'title_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/plain',
|
||||
'value': "Trump's 'genocidal taunts' will not "
|
||||
'end Iran - Zarif'
|
||||
"guidislink": False,
|
||||
"href": "",
|
||||
"link": "https://www.bbc.co.uk/news/world-us-canada-48338168",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://www.bbc.co.uk/news/world-us-canada-48338168",
|
||||
"rel": "alternate",
|
||||
"type": "text/html",
|
||||
}
|
||||
},
|
||||
],
|
||||
"media_thumbnail": [
|
||||
{
|
||||
'guidislink': False,
|
||||
'href': '',
|
||||
'link': 'https://www.bbc.co.uk/news/technology-48334739',
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/technology-48334739',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'media_thumbnail': [{
|
||||
'height': '432',
|
||||
'url': 'http://c.files.bbci.co.uk/4789/production/_107031381_mediaitem107028670.jpg',
|
||||
'width': '768'
|
||||
}],
|
||||
'published': 'Mon, 20 May 2019 12:19:19 GMT',
|
||||
'published_parsed': struct_time((2019, 5, 20, 12, 19, 19, 0, 140, 0,)),
|
||||
'summary': "Google's move to end business ties with Huawei will "
|
||||
'affect current devices and future purchases.',
|
||||
'summary_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/html',
|
||||
'value': "Google's move to end business ties "
|
||||
'with Huawei will affect current '
|
||||
'devices and future purchases.'
|
||||
},
|
||||
'title': "Huawei's Android loss: How it affects you",
|
||||
'title_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/plain',
|
||||
'value': "Huawei's Android loss: How it "
|
||||
'affects you'
|
||||
"height": "1152",
|
||||
"url": "http://c.files.bbci.co.uk/7605/production/_107031203_mediaitem107031202.jpg",
|
||||
"width": "2048",
|
||||
}
|
||||
],
|
||||
"published": "Mon, 20 May 2019 16:07:37 GMT",
|
||||
"published_parsed": struct_time((2019, 5, 20, 16, 7, 37, 0, 140, 0)),
|
||||
"summary": "Foreign Minister Mohammad Javad Zarif says the US "
|
||||
"president should try showing Iranians some respect.",
|
||||
"summary_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/html",
|
||||
"value": "Foreign Minister Mohammad Javad "
|
||||
"Zarif says the US president should "
|
||||
"try showing Iranians some "
|
||||
"respect.",
|
||||
},
|
||||
"title": "Trump's 'genocidal taunts' will not end Iran - Zarif",
|
||||
"title_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/plain",
|
||||
"value": "Trump's 'genocidal taunts' will not " "end Iran - Zarif",
|
||||
},
|
||||
},
|
||||
{
|
||||
'guidislink': False,
|
||||
'href': '',
|
||||
'link': 'https://www.bbc.co.uk/news/uk-england-birmingham-48339080',
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/uk-england-birmingham-48339080',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'media_thumbnail': [{
|
||||
'height': '549',
|
||||
'url': 'http://c.files.bbci.co.uk/11D67/production/_107036037_lgbtheadjpg.jpg',
|
||||
'width': '976'
|
||||
}],
|
||||
'published': 'Mon, 20 May 2019 16:32:38 GMT',
|
||||
'published_parsed': struct_time((2019, 5, 20, 16, 32, 38, 0, 140, 0)),
|
||||
'summary': 'Police are investigating the messages while an MP '
|
||||
"guidislink": False,
|
||||
"href": "",
|
||||
"link": "https://www.bbc.co.uk/news/technology-48334739",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://www.bbc.co.uk/news/technology-48334739",
|
||||
"rel": "alternate",
|
||||
"type": "text/html",
|
||||
}
|
||||
],
|
||||
"media_thumbnail": [
|
||||
{
|
||||
"height": "432",
|
||||
"url": "http://c.files.bbci.co.uk/4789/production/_107031381_mediaitem107028670.jpg",
|
||||
"width": "768",
|
||||
}
|
||||
],
|
||||
"published": "Mon, 20 May 2019 12:19:19 GMT",
|
||||
"published_parsed": struct_time((2019, 5, 20, 12, 19, 19, 0, 140, 0)),
|
||||
"summary": "Google's move to end business ties with Huawei will "
|
||||
"affect current devices and future purchases.",
|
||||
"summary_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/html",
|
||||
"value": "Google's move to end business ties "
|
||||
"with Huawei will affect current "
|
||||
"devices and future purchases.",
|
||||
},
|
||||
"title": "Huawei's Android loss: How it affects you",
|
||||
"title_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/plain",
|
||||
"value": "Huawei's Android loss: How it " "affects you",
|
||||
},
|
||||
},
|
||||
{
|
||||
"guidislink": False,
|
||||
"href": "",
|
||||
"link": "https://www.bbc.co.uk/news/uk-england-birmingham-48339080",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://www.bbc.co.uk/news/uk-england-birmingham-48339080",
|
||||
"rel": "alternate",
|
||||
"type": "text/html",
|
||||
}
|
||||
],
|
||||
"media_thumbnail": [
|
||||
{
|
||||
"height": "549",
|
||||
"url": "http://c.files.bbci.co.uk/11D67/production/_107036037_lgbtheadjpg.jpg",
|
||||
"width": "976",
|
||||
}
|
||||
],
|
||||
"published": "Mon, 20 May 2019 16:32:38 GMT",
|
||||
"published_parsed": struct_time((2019, 5, 20, 16, 32, 38, 0, 140, 0)),
|
||||
"summary": "Police are investigating the messages while an MP "
|
||||
'calls for a protest exclusion zone "to protect '
|
||||
'children".',
|
||||
'summary_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/html',
|
||||
'value': 'Police are investigating the '
|
||||
'messages while an MP calls for a '
|
||||
"summary_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/html",
|
||||
"value": "Police are investigating the "
|
||||
"messages while an MP calls for a "
|
||||
'protest exclusion zone "to protect '
|
||||
'children".'
|
||||
'children".',
|
||||
},
|
||||
"title": "Birmingham head teacher threatened over LGBT lessons",
|
||||
"title_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/plain",
|
||||
"value": "Birmingham head teacher threatened " "over LGBT lessons",
|
||||
},
|
||||
'title': 'Birmingham head teacher threatened over LGBT lessons',
|
||||
'title_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/plain',
|
||||
'value': 'Birmingham head teacher threatened '
|
||||
'over LGBT lessons'
|
||||
}
|
||||
},
|
||||
],
|
||||
'feed': {
|
||||
'image': {
|
||||
'href': 'https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif',
|
||||
'link': 'https://www.bbc.co.uk/news/',
|
||||
'title': 'BBC News - Home',
|
||||
'language': 'en-gb',
|
||||
'link': 'https://www.bbc.co.uk/news/'
|
||||
"feed": {
|
||||
"image": {
|
||||
"href": "https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif",
|
||||
"link": "https://www.bbc.co.uk/news/",
|
||||
"title": "BBC News - Home",
|
||||
"language": "en-gb",
|
||||
"link": "https://www.bbc.co.uk/news/",
|
||||
},
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'title': 'BBC News - Home',
|
||||
"links": [{"href": "https://www.bbc.co.uk/news/", "rel": "alternate", "type": "text/html"}],
|
||||
"title": "BBC News - Home",
|
||||
},
|
||||
'href': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'status': 200,
|
||||
'version': 'rss20'
|
||||
"href": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"status": 200,
|
||||
"version": "rss20",
|
||||
}
|
||||
|
||||
multiple_update_mock = {
|
||||
'bozo': 0,
|
||||
'encoding': 'utf-8',
|
||||
'entries': [
|
||||
"bozo": 0,
|
||||
"encoding": "utf-8",
|
||||
"entries": [
|
||||
{
|
||||
'guidislink': False,
|
||||
'href': '',
|
||||
'id': 'https://www.bbc.co.uk/news/world-us-canada-48338168',
|
||||
'link': 'https://www.bbc.co.uk/news/world-us-canada-48338168',
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/world-us-canada-48338168',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'media_thumbnail': [{
|
||||
'height': '1152',
|
||||
'url': 'http://c.files.bbci.co.uk/7605/production/_107031203_mediaitem107031202.jpg',
|
||||
'width': '2048'
|
||||
}],
|
||||
'published': 'Mon, 20 May 2019 16:07:37 GMT',
|
||||
'published_parsed': struct_time((2019, 5, 20, 16, 7, 37, 0, 140, 0)),
|
||||
'summary': 'Foreign Minister Mohammad Javad Zarif says the US '
|
||||
'president should try showing Iranians some respect.',
|
||||
'summary_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/html',
|
||||
'value': 'Foreign Minister Mohammad Javad '
|
||||
'Zarif says the US president should '
|
||||
'try showing Iranians some '
|
||||
'respect.'
|
||||
},
|
||||
'title': "Trump's 'genocidal taunts' will not end Iran - Zarif",
|
||||
'title_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/plain',
|
||||
'value': "Trump's 'genocidal taunts' will not "
|
||||
'end Iran - Zarif'
|
||||
"guidislink": False,
|
||||
"href": "",
|
||||
"id": "https://www.bbc.co.uk/news/world-us-canada-48338168",
|
||||
"link": "https://www.bbc.co.uk/news/world-us-canada-48338168",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://www.bbc.co.uk/news/world-us-canada-48338168",
|
||||
"rel": "alternate",
|
||||
"type": "text/html",
|
||||
}
|
||||
},
|
||||
],
|
||||
"media_thumbnail": [
|
||||
{
|
||||
'guidislink': False,
|
||||
'href': '',
|
||||
'id': 'https://www.bbc.co.uk/news/technology-48334739',
|
||||
'link': 'https://www.bbc.co.uk/news/technology-48334739',
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/technology-48334739',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'media_thumbnail': [{
|
||||
'height': '432',
|
||||
'url': 'http://c.files.bbci.co.uk/4789/production/_107031381_mediaitem107028670.jpg',
|
||||
'width': '768'
|
||||
}],
|
||||
'published': 'Mon, 20 May 2019 12:19:19 GMT',
|
||||
'published_parsed': struct_time((2019, 5, 20, 12, 19, 19, 0, 140, 0,)),
|
||||
'summary': "Google's move to end business ties with Huawei will "
|
||||
'affect current devices and future purchases.',
|
||||
'summary_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/html',
|
||||
'value': "Google's move to end business ties "
|
||||
'with Huawei will affect current '
|
||||
'devices and future purchases.'
|
||||
},
|
||||
'title': "Huawei's Android loss: How it affects you",
|
||||
'title_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/plain',
|
||||
'value': "Huawei's Android loss: How it "
|
||||
'affects you'
|
||||
"height": "1152",
|
||||
"url": "http://c.files.bbci.co.uk/7605/production/_107031203_mediaitem107031202.jpg",
|
||||
"width": "2048",
|
||||
}
|
||||
],
|
||||
"published": "Mon, 20 May 2019 16:07:37 GMT",
|
||||
"published_parsed": struct_time((2019, 5, 20, 16, 7, 37, 0, 140, 0)),
|
||||
"summary": "Foreign Minister Mohammad Javad Zarif says the US "
|
||||
"president should try showing Iranians some respect.",
|
||||
"summary_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/html",
|
||||
"value": "Foreign Minister Mohammad Javad "
|
||||
"Zarif says the US president should "
|
||||
"try showing Iranians some "
|
||||
"respect.",
|
||||
},
|
||||
"title": "Trump's 'genocidal taunts' will not end Iran - Zarif",
|
||||
"title_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/plain",
|
||||
"value": "Trump's 'genocidal taunts' will not " "end Iran - Zarif",
|
||||
},
|
||||
},
|
||||
{
|
||||
'guidislink': False,
|
||||
'href': '',
|
||||
'id': 'https://www.bbc.co.uk/news/uk-england-birmingham-48339080',
|
||||
'link': 'https://www.bbc.co.uk/news/uk-england-birmingham-48339080',
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/uk-england-birmingham-48339080',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'media_thumbnail': [{
|
||||
'height': '549',
|
||||
'url': 'http://c.files.bbci.co.uk/11D67/production/_107036037_lgbtheadjpg.jpg',
|
||||
'width': '976'
|
||||
}],
|
||||
'published': 'Mon, 20 May 2019 16:32:38 GMT',
|
||||
'published_parsed': struct_time((2019, 5, 20, 16, 32, 38, 0, 140, 0)),
|
||||
'summary': 'Police are investigating the messages while an MP '
|
||||
"guidislink": False,
|
||||
"href": "",
|
||||
"id": "https://www.bbc.co.uk/news/technology-48334739",
|
||||
"link": "https://www.bbc.co.uk/news/technology-48334739",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://www.bbc.co.uk/news/technology-48334739",
|
||||
"rel": "alternate",
|
||||
"type": "text/html",
|
||||
}
|
||||
],
|
||||
"media_thumbnail": [
|
||||
{
|
||||
"height": "432",
|
||||
"url": "http://c.files.bbci.co.uk/4789/production/_107031381_mediaitem107028670.jpg",
|
||||
"width": "768",
|
||||
}
|
||||
],
|
||||
"published": "Mon, 20 May 2019 12:19:19 GMT",
|
||||
"published_parsed": struct_time((2019, 5, 20, 12, 19, 19, 0, 140, 0)),
|
||||
"summary": "Google's move to end business ties with Huawei will "
|
||||
"affect current devices and future purchases.",
|
||||
"summary_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/html",
|
||||
"value": "Google's move to end business ties "
|
||||
"with Huawei will affect current "
|
||||
"devices and future purchases.",
|
||||
},
|
||||
"title": "Huawei's Android loss: How it affects you",
|
||||
"title_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/plain",
|
||||
"value": "Huawei's Android loss: How it " "affects you",
|
||||
},
|
||||
},
|
||||
{
|
||||
"guidislink": False,
|
||||
"href": "",
|
||||
"id": "https://www.bbc.co.uk/news/uk-england-birmingham-48339080",
|
||||
"link": "https://www.bbc.co.uk/news/uk-england-birmingham-48339080",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://www.bbc.co.uk/news/uk-england-birmingham-48339080",
|
||||
"rel": "alternate",
|
||||
"type": "text/html",
|
||||
}
|
||||
],
|
||||
"media_thumbnail": [
|
||||
{
|
||||
"height": "549",
|
||||
"url": "http://c.files.bbci.co.uk/11D67/production/_107036037_lgbtheadjpg.jpg",
|
||||
"width": "976",
|
||||
}
|
||||
],
|
||||
"published": "Mon, 20 May 2019 16:32:38 GMT",
|
||||
"published_parsed": struct_time((2019, 5, 20, 16, 32, 38, 0, 140, 0)),
|
||||
"summary": "Police are investigating the messages while an MP "
|
||||
'calls for a protest exclusion zone "to protect '
|
||||
'children".',
|
||||
'summary_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/html',
|
||||
'value': 'Police are investigating the '
|
||||
'messages while an MP calls for a '
|
||||
"summary_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/html",
|
||||
"value": "Police are investigating the "
|
||||
"messages while an MP calls for a "
|
||||
'protest exclusion zone "to protect '
|
||||
'children".'
|
||||
'children".',
|
||||
},
|
||||
"title": "Birmingham head teacher threatened over LGBT lessons",
|
||||
"title_detail": {
|
||||
"base": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"language": None,
|
||||
"type": "text/plain",
|
||||
"value": "Birmingham head teacher threatened " "over LGBT lessons",
|
||||
},
|
||||
'title': 'Birmingham head teacher threatened over LGBT lessons',
|
||||
'title_detail': {
|
||||
'base': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'language': None,
|
||||
'type': 'text/plain',
|
||||
'value': 'Birmingham head teacher threatened '
|
||||
'over LGBT lessons'
|
||||
}
|
||||
},
|
||||
],
|
||||
'feed': {
|
||||
'image': {
|
||||
'href': 'https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif',
|
||||
'link': 'https://www.bbc.co.uk/news/',
|
||||
'title': 'BBC News - Home',
|
||||
'language': 'en-gb',
|
||||
'link': 'https://www.bbc.co.uk/news/'
|
||||
"feed": {
|
||||
"image": {
|
||||
"href": "https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif",
|
||||
"link": "https://www.bbc.co.uk/news/",
|
||||
"title": "BBC News - Home",
|
||||
"language": "en-gb",
|
||||
"link": "https://www.bbc.co.uk/news/",
|
||||
},
|
||||
'links': [{
|
||||
'href': 'https://www.bbc.co.uk/news/',
|
||||
'rel': 'alternate',
|
||||
'type': 'text/html'
|
||||
}],
|
||||
'title': 'BBC News - Home',
|
||||
"links": [{"href": "https://www.bbc.co.uk/news/", "rel": "alternate", "type": "text/html"}],
|
||||
"title": "BBC News - Home",
|
||||
},
|
||||
'href': 'http://feeds.bbci.co.uk/news/rss.xml',
|
||||
'status': 200,
|
||||
'version': 'rss20'
|
||||
"href": "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"status": 200,
|
||||
"version": "rss20",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,20 +2,13 @@ from datetime import date, datetime, time
|
|||
from time import struct_time
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from django.test import TestCase
|
||||
from django.utils import timezone
|
||||
|
||||
import pytz
|
||||
|
||||
from freezegun import freeze_time
|
||||
|
||||
from .mocks import (
|
||||
duplicate_mock,
|
||||
empty_mock,
|
||||
multiple_mock,
|
||||
multiple_update_mock,
|
||||
)
|
||||
|
||||
from django.test import TestCase
|
||||
from django.utils import timezone
|
||||
|
||||
from newsreader.news.collection.exceptions import (
|
||||
StreamDeniedException,
|
||||
StreamException,
|
||||
|
|
@ -30,6 +23,13 @@ from newsreader.news.collection.utils import build_publication_date
|
|||
from newsreader.news.posts.models import Post
|
||||
from newsreader.news.posts.tests.factories import PostFactory
|
||||
|
||||
from .mocks import (
|
||||
duplicate_mock,
|
||||
empty_mock,
|
||||
multiple_mock,
|
||||
multiple_update_mock,
|
||||
)
|
||||
|
||||
|
||||
class FeedCollectorTestCase(TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from time import struct_time
|
||||
|
||||
|
||||
simple_mock = {
|
||||
"bozo": 1,
|
||||
"encoding": "utf-8",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from .mocks import simple_mock
|
||||
|
||||
from django.test import TestCase
|
||||
from django.utils import timezone
|
||||
|
||||
|
|
@ -16,6 +14,8 @@ from newsreader.news.collection.exceptions import (
|
|||
from newsreader.news.collection.feed import FeedStream
|
||||
from newsreader.news.collection.tests.factories import CollectionRuleFactory
|
||||
|
||||
from .mocks import simple_mock
|
||||
|
||||
|
||||
class FeedStreamTestCase(TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from .mocks import feed_mock_without_link, simple_feed_mock, simple_mock
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from newsreader.news.collection.base import URLBuilder, WebsiteStream
|
||||
from newsreader.news.collection.exceptions import (
|
||||
StreamDeniedException,
|
||||
|
|
@ -17,6 +15,8 @@ from newsreader.news.collection.exceptions import (
|
|||
)
|
||||
from newsreader.news.collection.tests.factories import CollectionRuleFactory
|
||||
|
||||
from .mocks import feed_mock_without_link, simple_feed_mock, simple_mock
|
||||
|
||||
|
||||
class WebsiteStreamTestCase(TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from requests.exceptions import ConnectionError as RequestConnectionError
|
||||
from requests.exceptions import (
|
||||
HTTPError,
|
||||
|
|
@ -8,8 +10,6 @@ from requests.exceptions import (
|
|||
TooManyRedirects,
|
||||
)
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from newsreader.news.collection.exceptions import (
|
||||
StreamConnectionError,
|
||||
StreamDeniedException,
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ from datetime import datetime, tzinfo
|
|||
from time import mktime, struct_time
|
||||
from typing import Tuple
|
||||
|
||||
from django.utils import timezone
|
||||
|
||||
import requests
|
||||
|
||||
from requests.exceptions import RequestException
|
||||
from requests.models import Response
|
||||
|
||||
from django.utils import timezone
|
||||
|
||||
from newsreader.news.collection.response_handler import ResponseHandler
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
|
||||
# Create your views here.
|
||||
|
|
|
|||
|
|
@ -4,26 +4,13 @@ from newsreader.news.posts.models import Category, Post
|
|||
|
||||
|
||||
class PostAdmin(admin.ModelAdmin):
|
||||
list_display = (
|
||||
"publication_date",
|
||||
"author",
|
||||
"rule",
|
||||
"title",
|
||||
)
|
||||
list_display = ("publication_date", "author", "rule", "title")
|
||||
list_display_links = ("title",)
|
||||
list_filter = ("rule",)
|
||||
|
||||
ordering = ("-publication_date", "title")
|
||||
|
||||
fields = (
|
||||
"title",
|
||||
"body",
|
||||
"author",
|
||||
"publication_date",
|
||||
"url",
|
||||
"remote_identifier",
|
||||
"category",
|
||||
)
|
||||
fields = ("title", "body", "author", "publication_date", "url", "remote_identifier", "category")
|
||||
|
||||
search_fields = ["title"]
|
||||
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@ from django.apps import AppConfig
|
|||
|
||||
|
||||
class PostsConfig(AppConfig):
|
||||
name = 'posts'
|
||||
name = "posts"
|
||||
|
|
|
|||
|
|
@ -9,70 +9,57 @@ class Migration(migrations.Migration):
|
|||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('collection', '0001_initial'),
|
||||
]
|
||||
dependencies = [("collection", "0001_initial")]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Category',
|
||||
name="Category",
|
||||
fields=[
|
||||
(
|
||||
'id',
|
||||
"id",
|
||||
models.AutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name='ID'
|
||||
)
|
||||
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
|
||||
),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('modified', models.DateTimeField(auto_now=True)),
|
||||
('name', models.CharField(max_length=50)),
|
||||
),
|
||||
("created", models.DateTimeField(auto_now_add=True)),
|
||||
("modified", models.DateTimeField(auto_now=True)),
|
||||
("name", models.CharField(max_length=50)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
options={"abstract": False},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Post',
|
||||
name="Post",
|
||||
fields=[
|
||||
(
|
||||
'id',
|
||||
"id",
|
||||
models.AutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name='ID'
|
||||
)
|
||||
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
|
||||
),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('modified', models.DateTimeField(auto_now=True)),
|
||||
('title', models.CharField(max_length=200)),
|
||||
('body', models.TextField()),
|
||||
('source', models.CharField(max_length=200)),
|
||||
('publication_date', models.DateTimeField()),
|
||||
('url', models.URLField()),
|
||||
('remote_identifier', models.CharField(max_length=500)),
|
||||
),
|
||||
("created", models.DateTimeField(auto_now_add=True)),
|
||||
("modified", models.DateTimeField(auto_now=True)),
|
||||
("title", models.CharField(max_length=200)),
|
||||
("body", models.TextField()),
|
||||
("source", models.CharField(max_length=200)),
|
||||
("publication_date", models.DateTimeField()),
|
||||
("url", models.URLField()),
|
||||
("remote_identifier", models.CharField(max_length=500)),
|
||||
(
|
||||
'category',
|
||||
"category",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
to='posts.Category'
|
||||
)
|
||||
to="posts.Category",
|
||||
),
|
||||
),
|
||||
(
|
||||
'rule',
|
||||
"rule",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to='collection.CollectionRule'
|
||||
)
|
||||
on_delete=django.db.models.deletion.CASCADE, to="collection.CollectionRule"
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
options={"abstract": False},
|
||||
),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -5,16 +5,11 @@ from django.db import migrations
|
|||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('posts', '0001_initial'),
|
||||
]
|
||||
dependencies = [("posts", "0001_initial")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='category',
|
||||
options={
|
||||
'verbose_name': 'Category',
|
||||
'verbose_name_plural': 'Categories'
|
||||
},
|
||||
),
|
||||
name="category",
|
||||
options={"verbose_name": "Category", "verbose_name_plural": "Categories"},
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -5,14 +5,10 @@ from django.db import migrations, models
|
|||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('posts', '0002_auto_20190520_2206'),
|
||||
]
|
||||
dependencies = [("posts", "0002_auto_20190520_2206")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='category',
|
||||
name='name',
|
||||
field=models.CharField(max_length=50, unique=True),
|
||||
),
|
||||
model_name="category", name="name", field=models.CharField(max_length=50, unique=True)
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -5,18 +5,13 @@ from django.db import migrations, models
|
|||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('posts', '0003_auto_20190520_2031'),
|
||||
]
|
||||
dependencies = [("posts", "0003_auto_20190520_2031")]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='post',
|
||||
name='source',
|
||||
),
|
||||
migrations.RemoveField(model_name="post", name="source"),
|
||||
migrations.AddField(
|
||||
model_name='post',
|
||||
name='author',
|
||||
model_name="post",
|
||||
name="author",
|
||||
field=models.CharField(blank=True, max_length=100, null=True),
|
||||
),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -5,19 +5,13 @@ from django.db import migrations, models
|
|||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('posts', '0004_auto_20190521_1941'),
|
||||
]
|
||||
dependencies = [("posts", "0004_auto_20190521_1941")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(model_name="post", name="body", field=models.TextField(blank=True)),
|
||||
migrations.AlterField(
|
||||
model_name='post',
|
||||
name='body',
|
||||
field=models.TextField(blank=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='post',
|
||||
name='remote_identifier',
|
||||
model_name="post",
|
||||
name="remote_identifier",
|
||||
field=models.CharField(blank=True, max_length=500, null=True),
|
||||
),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -5,29 +5,23 @@ from django.db import migrations, models
|
|||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('posts', '0005_auto_20190608_1054'),
|
||||
]
|
||||
dependencies = [("posts", "0005_auto_20190608_1054")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='post',
|
||||
name='body',
|
||||
field=models.TextField(blank=True, null=True),
|
||||
model_name="post", name="body", field=models.TextField(blank=True, null=True)
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='post',
|
||||
name='publication_date',
|
||||
model_name="post",
|
||||
name="publication_date",
|
||||
field=models.DateTimeField(blank=True, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='post',
|
||||
name='title',
|
||||
model_name="post",
|
||||
name="title",
|
||||
field=models.CharField(blank=True, max_length=200, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='post',
|
||||
name='url',
|
||||
field=models.URLField(blank=True, null=True),
|
||||
model_name="post", name="url", field=models.URLField(blank=True, null=True)
|
||||
),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -15,9 +15,7 @@ class Post(TimeStampedModel):
|
|||
rule = models.ForeignKey(CollectionRule, on_delete=models.CASCADE)
|
||||
remote_identifier = models.CharField(max_length=500, blank=True, null=True)
|
||||
|
||||
category = models.ForeignKey(
|
||||
'Category', blank=True, null=True, on_delete=models.PROTECT
|
||||
)
|
||||
category = models.ForeignKey("Category", blank=True, null=True, on_delete=models.PROTECT)
|
||||
|
||||
def __str__(self):
|
||||
return "Post-{}".format(self.pk)
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ class PostFactory(factory.django.DjangoModelFactory):
|
|||
title = factory.Faker("sentence")
|
||||
body = factory.Faker("paragraph")
|
||||
author = factory.Faker("name")
|
||||
publication_date = factory.Faker('date_time_this_year', tzinfo=pytz.utc)
|
||||
url = factory.Faker('url')
|
||||
publication_date = factory.Faker("date_time_this_year", tzinfo=pytz.utc)
|
||||
url = factory.Faker("url")
|
||||
remote_identifier = factory.Faker("url")
|
||||
|
||||
rule = factory.SubFactory(CollectionRuleFactory)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
|
||||
# Create your views here.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
from django.contrib import admin
|
||||
from django.urls import include, path
|
||||
|
||||
urlpatterns = [
|
||||
path("admin/", admin.site.urls),
|
||||
]
|
||||
|
||||
urlpatterns = [path("admin/", admin.site.urls)]
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import os
|
|||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'newsreader.settings')
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "newsreader.settings")
|
||||
|
||||
application = get_wsgi_application()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue