Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for django 5.x and fix test_ssr.py #48

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion inertia/tests/test_ssr.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from json import dumps
from inertia.test import InertiaTestCase, inertia_page, inertia_div
from django.test import override_settings
from unittest.mock import patch, Mock
Expand All @@ -24,7 +25,8 @@ def test_it_returns_ssr_calls(self, mock_request):

mock_request.post.assert_called_once_with(
'ssr-url/render',
json=inertia_page('props', props={'name': 'Brandon', 'sport': 'Hockey'}),
data=dumps(inertia_page('props', props={'name': 'Brandon', 'sport': 'Hockey'})),
headers={'Content-Type': 'application/json'}
)
self.assertTemplateUsed('inertia_ssr.html')
print(response.content)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ packages = [
]

[tool.poetry.dependencies]
python = "^3.8"
django = ">=4"
python = ">=3.10"
django = "^5.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably should leave the Django version as is, version locking like this will drop compatibility with Django 4.

requests = "^2"

[tool.poetry.dev-dependencies]
Expand Down