Skip to content

Commit

Permalink
Cleanup unneeded stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilStenstrom committed May 2, 2024
1 parent 9b56f1d commit 7de554b
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions tests/test_component_as_view.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from typing import Any, Dict

from django.conf import settings
from django.http import HttpResponse
from django.template import Context, Template
from django.test import Client
from django.urls import include, path
from django.urls import path

# isort: off
from .django_test_setup import * # noqa
from .testutils import BaseTestCase

# isort: on

from django_components import component
Expand All @@ -25,16 +25,7 @@ def __init__(self, urlpatterns=None, *args, **kwargs):
settings.SECRET_KEY = "secret" # noqa
super().__init__(*args, **kwargs)


#########################
# TESTS
#########################


class TestComponentAsView(BaseTestCase):
def setUp(self):
self.client = CustomClient()

def test_render_component_from_template(self):
@component.register("testcomponent")
class MockComponentRequest(component.Component):
Expand All @@ -46,10 +37,6 @@ class MockComponentRequest(component.Component):
</form>
"""

def post(self, request, *args, **kwargs) -> HttpResponse:
variable = request.POST.get("variable")
return self.render_to_response({"variable": variable})

def get(self, request, *args, **kwargs) -> HttpResponse:
return self.render_to_response({"variable": "GET"})

Expand Down

0 comments on commit 7de554b

Please sign in to comment.