mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
python3/django3 upgrades
This commit is contained in:
parent
fc7eaa95a0
commit
83048ce0ca
4 changed files with 4 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
from utils import json_functions as json
|
||||
from django.test.client import Client
|
||||
from django.test import TestCase
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.conf import settings
|
||||
from mongoengine.connection import connect, disconnect
|
||||
|
||||
|
|
|
@ -30,8 +30,7 @@ class PushSubscriptionManager(models.Manager):
|
|||
if lease_seconds is None:
|
||||
lease_seconds = getattr(settings, 'PUBSUBHUBBUB_LEASE_SECONDS',
|
||||
DEFAULT_LEASE_SECONDS)
|
||||
|
||||
feed = Feed.get_by_id(feed.pk)
|
||||
feed = Feed.get_by_id(feed.id)
|
||||
subscription, created = self.get_or_create(feed=feed)
|
||||
signals.pre_subscribe.send(sender=subscription, created=created)
|
||||
subscription.set_expiration(lease_seconds)
|
||||
|
|
|
@ -147,7 +147,7 @@ class PSHBSubscriptionManagerTest(PSHBTestBase, TestCase):
|
|||
self.responses.append(MockResponse(500, 'error data'))
|
||||
try:
|
||||
PushSubscription.objects.subscribe('topic', 'hub', 'callback')
|
||||
except urllib.URLError as e:
|
||||
except urllib.error.URLError as e:
|
||||
self.assertEquals(e.reason,
|
||||
'error subscribing to topic on hub:\nerror data')
|
||||
else:
|
||||
|
|
|
@ -33,4 +33,4 @@ class UserSubscriptionManager(models.Manager):
|
|||
return super(UserSubscriptionManager, self).get(*args, **kwargs)
|
||||
else:
|
||||
exc_info = sys.exc_info()
|
||||
raise exc_info[0].with_traceback(exc_info[2])
|
||||
raise exc_info[1]
|
||||
|
|
Loading…
Add table
Reference in a new issue