remove cache.sqlite;
remove app_be/services; remove app_be/views/tests; remove app_be/views/ws_api.py; remove app_be/routing.py; remove app_be/tests.py;
This commit is contained in:
parent
212062ecdf
commit
838845e65f
@ -1,17 +0,0 @@
|
||||
from django.conf.urls import url
|
||||
|
||||
from channels.routing import ProtocolTypeRouter, URLRouter
|
||||
from channels.sessions import SessionMiddlewareStack
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
from .views.ws_api import CustomConsumer
|
||||
|
||||
application = ProtocolTypeRouter({
|
||||
# Django's ASGI application to handle traditional HTTP requests
|
||||
"http": get_asgi_application(),
|
||||
|
||||
# WebSocket send handler
|
||||
"websocket": SessionMiddlewareStack(URLRouter([
|
||||
url(r"^test-ws-endpoint/$", CustomConsumer.as_asgi()),
|
||||
]))
|
||||
})
|
||||
@ -1,15 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APITestCase
|
||||
|
||||
|
||||
class AccountTests(APITestCase):
|
||||
def test_create_account(self):
|
||||
"""
|
||||
Ensure we can create a new account object.
|
||||
"""
|
||||
url = '/test/'
|
||||
response = self.client.get(url, format='json')
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
@ -1,18 +0,0 @@
|
||||
import logging
|
||||
|
||||
from channels.generic.websocket import WebsocketConsumer
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class CustomConsumer(WebsocketConsumer):
|
||||
def connect(self):
|
||||
self.accept()
|
||||
|
||||
def receive(self, text_data=None, bytes_data=None):
|
||||
self.send('1. response: {}'.format(text_data))
|
||||
self.send('2. response: {}'.format(text_data))
|
||||
|
||||
def disconnect(self, code):
|
||||
pass
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user