mirror of
https://github.com/django-components/django-components.git
synced 2025-11-12 20:08:09 +00:00
refactor: make Component.View.public optional (#1451)
Some checks are pending
Docs - build & deploy / docs (push) Waiting to run
Run tests / build (windows-latest, 3.10) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.10) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.11) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.12) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.8) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.9) (push) Waiting to run
Run tests / build (windows-latest, 3.11) (push) Waiting to run
Run tests / build (windows-latest, 3.12) (push) Waiting to run
Run tests / build (windows-latest, 3.13) (push) Waiting to run
Run tests / build (windows-latest, 3.8) (push) Waiting to run
Run tests / build (windows-latest, 3.9) (push) Waiting to run
Run tests / test_docs (3.13) (push) Waiting to run
Run tests / test_sampleproject (3.13) (push) Waiting to run
Some checks are pending
Docs - build & deploy / docs (push) Waiting to run
Run tests / build (windows-latest, 3.10) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.10) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.11) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.12) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.8) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.9) (push) Waiting to run
Run tests / build (windows-latest, 3.11) (push) Waiting to run
Run tests / build (windows-latest, 3.12) (push) Waiting to run
Run tests / build (windows-latest, 3.13) (push) Waiting to run
Run tests / build (windows-latest, 3.8) (push) Waiting to run
Run tests / build (windows-latest, 3.9) (push) Waiting to run
Run tests / test_docs (3.13) (push) Waiting to run
Run tests / test_sampleproject (3.13) (push) Waiting to run
Co-authored-by: RohanDisa <105740583+RohanDisa@users.noreply.github.com>
This commit is contained in:
parent
b17214f536
commit
485027b308
11 changed files with 202 additions and 71 deletions
|
|
@ -19,7 +19,6 @@ from pytest_django.asserts import assertHTMLEqual, assertInHTML
|
|||
from django_components import (
|
||||
Component,
|
||||
ComponentRegistry,
|
||||
ComponentView,
|
||||
Slot,
|
||||
SlotInput,
|
||||
all_components,
|
||||
|
|
@ -1240,12 +1239,12 @@ class TestComponentRender:
|
|||
def get_template_data(self, args, kwargs, slots, context):
|
||||
return {"how": kwargs.pop("how")}
|
||||
|
||||
class View(ComponentView):
|
||||
class View:
|
||||
def get(self, request):
|
||||
how = "via GET request"
|
||||
|
||||
return self.component.render_to_response(
|
||||
context=RequestContext(self.request),
|
||||
return self.component_cls.render_to_response( # type: ignore[attr-defined]
|
||||
context=RequestContext(request),
|
||||
kwargs={"how": how},
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue