mirror of
https://github.com/django/daphne.git
synced 2025-07-14 09:52:17 +03:00
Patchinator/django fixes
This commit is contained in:
parent
2eb8e9277e
commit
d29f02fb33
|
@ -17,7 +17,7 @@ from django.http import FileResponse, HttpResponse, HttpResponseServerError
|
||||||
from django.utils import six
|
from django.utils import six
|
||||||
from django.utils.functional import cached_property
|
from django.utils.functional import cached_property
|
||||||
|
|
||||||
from .exceptions import ResponseLater as ResponseLaterOuter, RequestTimeout, RequestAborted
|
from channels.exceptions import ResponseLater as ResponseLaterOuter, RequestTimeout, RequestAborted
|
||||||
|
|
||||||
logger = logging.getLogger('django.request')
|
logger = logging.getLogger('django.request')
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from asgiref.conformance import ConformanceTestCase
|
from asgiref.conformance import ConformanceTestCase
|
||||||
from ..database_layer import DatabaseChannelLayer
|
from channels.database_layer import DatabaseChannelLayer
|
||||||
|
|
||||||
|
|
||||||
class DatabaseLayerTests(ConformanceTestCase):
|
class DatabaseLayerTests(ConformanceTestCase):
|
||||||
|
|
|
@ -80,6 +80,7 @@ class RoutingTests(SimpleTestCase):
|
||||||
Ensures the test consumers don't compare equal, as if this ever happens
|
Ensures the test consumers don't compare equal, as if this ever happens
|
||||||
this test file will pass and miss most bugs.
|
this test file will pass and miss most bugs.
|
||||||
"""
|
"""
|
||||||
|
self.assertEqual(consumer_1, consumer_1)
|
||||||
self.assertNotEqual(consumer_1, consumer_2)
|
self.assertNotEqual(consumer_1, consumer_2)
|
||||||
self.assertNotEqual(consumer_1, consumer_3)
|
self.assertNotEqual(consumer_1, consumer_3)
|
||||||
|
|
||||||
|
|
|
@ -105,14 +105,17 @@ global_transforms = [
|
||||||
Replacement(r"import channels.([a-zA-Z0-9_\.]+)$", r"import django.channels.\1 as channels"),
|
Replacement(r"import channels.([a-zA-Z0-9_\.]+)$", r"import django.channels.\1 as channels"),
|
||||||
Replacement(r"from channels import", r"from django.channels import"),
|
Replacement(r"from channels import", r"from django.channels import"),
|
||||||
Replacement(r"from channels.([a-zA-Z0-9_\.]+) import", r"from django.channels.\1 import"),
|
Replacement(r"from channels.([a-zA-Z0-9_\.]+) import", r"from django.channels.\1 import"),
|
||||||
Replacement(r"from .handler import", r"from django.core.handlers.asgi import")
|
Replacement(r"from .handler import", r"from django.core.handlers.asgi import"),
|
||||||
|
Replacement(r"from django.channels.tests import", r"from django.test.channels import"),
|
||||||
|
Replacement(r"from django.channels.handler import", r"from django.core.handlers.asgi import"),
|
||||||
|
Replacement(r"channels.tests.test_routing", r"channels_tests.test_routing")
|
||||||
]
|
]
|
||||||
|
|
||||||
docs_transforms = global_transforms + [
|
docs_transforms = global_transforms + [
|
||||||
Replacement(r":doc:`concepts`", r":doc:`topics/channels/concepts`"),
|
Replacement(r":doc:`concepts`", r":doc:`/topics/channels/concepts`"),
|
||||||
Replacement(r":doc:`deploying`", r":doc:`topics/channels/deploying`"),
|
Replacement(r":doc:`deploying`", r":doc:`/topics/channels/deploying`"),
|
||||||
Replacement(r":doc:`scaling`", r":doc:`topics/channels/scaling`"),
|
Replacement(r":doc:`scaling`", r":doc:`/topics/channels/scaling`"),
|
||||||
Replacement(r":doc:`getting-started`", r":doc:`intro/channels`"),
|
Replacement(r":doc:`getting-started`", r":doc:`/intro/channels`"),
|
||||||
Replacement(r"\n\(.*installation>`\)\n", r""),
|
Replacement(r"\n\(.*installation>`\)\n", r""),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -141,6 +144,9 @@ class Patchinator(object):
|
||||||
FileMap(
|
FileMap(
|
||||||
"channels/routing.py", "django/channels/routing.py", global_transforms,
|
"channels/routing.py", "django/channels/routing.py", global_transforms,
|
||||||
),
|
),
|
||||||
|
FileMap(
|
||||||
|
"channels/message.py", "django/channels/message.py", global_transforms,
|
||||||
|
),
|
||||||
FileMap(
|
FileMap(
|
||||||
"channels/sessions.py", "django/channels/sessions.py", global_transforms,
|
"channels/sessions.py", "django/channels/sessions.py", global_transforms,
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user