From d29f02fb3319825bc55ee6e047f24841a8d0a015 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Tue, 5 Apr 2016 16:20:49 -0700 Subject: [PATCH] Patchinator/django fixes --- channels/handler.py | 2 +- channels/tests/test_database_layer.py | 2 +- channels/tests/test_routing.py | 1 + patchinator.py | 16 +++++++++++----- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/channels/handler.py b/channels/handler.py index 69ed8a3..6af7acb 100644 --- a/channels/handler.py +++ b/channels/handler.py @@ -17,7 +17,7 @@ from django.http import FileResponse, HttpResponse, HttpResponseServerError from django.utils import six 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') diff --git a/channels/tests/test_database_layer.py b/channels/tests/test_database_layer.py index 4878157..b9a11c0 100644 --- a/channels/tests/test_database_layer.py +++ b/channels/tests/test_database_layer.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals from asgiref.conformance import ConformanceTestCase -from ..database_layer import DatabaseChannelLayer +from channels.database_layer import DatabaseChannelLayer class DatabaseLayerTests(ConformanceTestCase): diff --git a/channels/tests/test_routing.py b/channels/tests/test_routing.py index bfc44cd..891113f 100644 --- a/channels/tests/test_routing.py +++ b/channels/tests/test_routing.py @@ -80,6 +80,7 @@ class RoutingTests(SimpleTestCase): Ensures the test consumers don't compare equal, as if this ever happens 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_3) diff --git a/patchinator.py b/patchinator.py index 97de4a9..782497d 100644 --- a/patchinator.py +++ b/patchinator.py @@ -105,14 +105,17 @@ global_transforms = [ 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.([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 + [ - Replacement(r":doc:`concepts`", r":doc:`topics/channels/concepts`"), - Replacement(r":doc:`deploying`", r":doc:`topics/channels/deploying`"), - Replacement(r":doc:`scaling`", r":doc:`topics/channels/scaling`"), - Replacement(r":doc:`getting-started`", r":doc:`intro/channels`"), + Replacement(r":doc:`concepts`", r":doc:`/topics/channels/concepts`"), + Replacement(r":doc:`deploying`", r":doc:`/topics/channels/deploying`"), + Replacement(r":doc:`scaling`", r":doc:`/topics/channels/scaling`"), + Replacement(r":doc:`getting-started`", r":doc:`/intro/channels`"), Replacement(r"\n\(.*installation>`\)\n", r""), ] @@ -141,6 +144,9 @@ class Patchinator(object): FileMap( "channels/routing.py", "django/channels/routing.py", global_transforms, ), + FileMap( + "channels/message.py", "django/channels/message.py", global_transforms, + ), FileMap( "channels/sessions.py", "django/channels/sessions.py", global_transforms, ),