mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-11 21:40:17 +02:00
dropin replace sleeksmpp with slixmpp, alter test
This commit is contained in:
parent
28420a729e
commit
49e01157e7
@ -1,5 +1,6 @@
|
|||||||
from allianceauth.analytics.middleware import AnalyticsMiddleware
|
from allianceauth.analytics.middleware import AnalyticsMiddleware
|
||||||
from unittest.mock import Mock
|
from unittest.mock import Mock
|
||||||
|
from django.http import HttpResponse
|
||||||
|
|
||||||
from django.test.testcases import TestCase
|
from django.test.testcases import TestCase
|
||||||
|
|
||||||
@ -7,7 +8,7 @@ from django.test.testcases import TestCase
|
|||||||
class TestAnalyticsMiddleware(TestCase):
|
class TestAnalyticsMiddleware(TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.middleware = AnalyticsMiddleware()
|
self.middleware = AnalyticsMiddleware(HttpResponse)
|
||||||
self.request = Mock()
|
self.request = Mock()
|
||||||
self.request.headers = {
|
self.request.headers = {
|
||||||
"User-Agent": "AUTOMATED TEST"
|
"User-Agent": "AUTOMATED TEST"
|
||||||
|
@ -3,7 +3,7 @@ import random
|
|||||||
import string
|
import string
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
import sleekxmpp
|
import slixmpp
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from ofrestapi.users import Users as ofUsers
|
from ofrestapi.users import Users as ofUsers
|
||||||
from ofrestapi import exception
|
from ofrestapi import exception
|
||||||
@ -172,13 +172,13 @@ class OpenfireManager:
|
|||||||
raise PingBotException("Unable to connect to jabber server.")
|
raise PingBotException("Unable to connect to jabber server.")
|
||||||
|
|
||||||
|
|
||||||
class PingBot(sleekxmpp.ClientXMPP):
|
class PingBot(slixmpp.ClientXMPP):
|
||||||
"""
|
"""
|
||||||
A copy-paste of the example client bot from
|
A copy-paste of the example client bot from
|
||||||
http://sleekxmpp.com/getting_started/sendlogout.html
|
http://sleekxmpp.com/getting_started/sendlogout.html
|
||||||
"""
|
"""
|
||||||
def __init__(self, jid, password, recipient, message):
|
def __init__(self, jid, password, recipient, message):
|
||||||
sleekxmpp.ClientXMPP.__init__(self, jid, password)
|
slixmpp.ClientXMPP.__init__(self, jid, password)
|
||||||
|
|
||||||
self.reconnect_max_attempts = 5
|
self.reconnect_max_attempts = 5
|
||||||
self.auto_reconnect = False
|
self.auto_reconnect = False
|
||||||
|
2
setup.py
2
setup.py
@ -30,7 +30,7 @@ install_requires = [
|
|||||||
'django-celery-beat @ git+https://github.com/celery/django-celery-beat.git',
|
'django-celery-beat @ git+https://github.com/celery/django-celery-beat.git',
|
||||||
|
|
||||||
'openfire-restapi',
|
'openfire-restapi',
|
||||||
'sleekxmpp',
|
'slixmpp',
|
||||||
'pydiscourse',
|
'pydiscourse',
|
||||||
|
|
||||||
'django-esi @ git+https://gitlab.com/soratidus999/django-esi.git@py310',
|
'django-esi @ git+https://gitlab.com/soratidus999/django-esi.git@py310',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user