Skip to content

Commit

Permalink
Remove TurboStreamIterableResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
danjac committed Feb 1, 2021
1 parent 55c08ac commit 2731f82
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 54 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Third Party Libraries
from setuptools import setup

version = "0.0.29"
version = "0.0.30"

setup(
name="django-turbo-response",
Expand Down
2 changes: 0 additions & 2 deletions src/turbo_response/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from .response import (
TurboFrameResponse,
TurboFrameTemplateResponse,
TurboStreamIterableResponse,
TurboStreamResponse,
TurboStreamStreamingResponse,
TurboStreamTemplateResponse,
Expand All @@ -20,7 +19,6 @@
"TurboFrameResponse",
"TurboFrameTemplateResponse",
"TurboStream",
"TurboStreamIterableResponse",
"TurboStreamResponse",
"TurboStreamStreamingResponse",
"TurboStreamTemplateResponse",
Expand Down
22 changes: 0 additions & 22 deletions src/turbo_response/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,6 @@ def render():
"""


class TurboStreamIterableResponse(TurboStreamResponseMixin, HttpResponse):
"""Handles turbo-stream iterator responses. Each item should be wrapped in
turbo-stream tags.
For example:
.. code-block:: python
return TurboStreamIterableResponse(
[
render_turbo_stream(
"OK",
Action.REPLACE,
target=f"item-{i}"
) for i in range(3)
]
)
.. deprecated :: 0.0.29
use TurboStreamResponse
"""


class TurboStreamResponse(TurboStreamResponseMixin, HttpResponse):
"""Basic turbo-stream response.
Expand Down
29 changes: 0 additions & 29 deletions src/turbo_response/tests/test_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Action,
TurboFrameResponse,
TurboFrameTemplateResponse,
TurboStreamIterableResponse,
TurboStreamResponse,
TurboStreamStreamingResponse,
TurboStreamTemplateResponse,
Expand Down Expand Up @@ -57,34 +56,6 @@ def test_render_iterable(self):
)


class TestTurboStreamIterableResponse:
def test_render(self):

resp = TurboStreamIterableResponse(
[
render_turbo_stream(
content=f"test {i}", action=Action.REPLACE, target=f"test_{i}"
)
for i in range(1, 4)
]
)

assert resp["Content-Type"] == "text/vnd.turbo-stream.html; charset=utf-8"

assert (
b'<turbo-stream action="replace" target="test_1"><template>test 1'
in resp.content
)
assert (
b'<turbo-stream action="replace" target="test_2"><template>test 2'
in resp.content
)
assert (
b'<turbo-stream action="replace" target="test_3"><template>test 3'
in resp.content
)


class TestTurboFrameResponse:
def test_render(self):
resp = TurboFrameResponse("OK", dom_id="test")
Expand Down

0 comments on commit 2731f82

Please sign in to comment.