diff --git a/src/turbo_response/mixins.py b/src/turbo_response/mixins.py index a8383af..afbb81f 100644 --- a/src/turbo_response/mixins.py +++ b/src/turbo_response/mixins.py @@ -17,10 +17,10 @@ class TurboStreamMixin: turbo_stream_action: Optional[Action] = None turbo_stream_target: Optional[str] = None - is_multiple: bool = False + turbo_stream_multiple: bool = False - def is_turbo_stream_targets(self) -> bool: - return self.is_multiple + def is_turbo_stream_multiple(self) -> bool: + return self.turbo_stream_multiple def get_turbo_stream(self) -> TurboStreamAction: @@ -38,9 +38,10 @@ def get_turbo_stream(self) -> TurboStreamAction: f"turbo stream action not defined in {self.__class__}.get_turbo_stream_action" ) - return TurboStream(target, is_multiple=self.is_turbo_stream_targets()).action( - action - ) + return TurboStream( + target, + is_multiple=self.is_turbo_stream_multiple(), + ).action(action) def get_turbo_stream_action(self) -> Optional[Action]: """Returns the turbo-stream action parameter diff --git a/tests/test_views.py b/tests/test_views.py index 0190e61..e1aae5d 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -94,7 +94,7 @@ def get_response_content(self): resp = MyView.as_view( turbo_stream_target=".test", turbo_stream_action=Action.REPLACE, - is_multiple=True, + turbo_stream_multiple=True, )(req) assert resp.status_code == http.HTTPStatus.OK assert "text/vnd.turbo-stream.html;" in resp["Content-Type"]