Skip to content

Commit

Permalink
explicit django 5.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedaljawahiry committed Dec 27, 2023
1 parent 5c569c1 commit b86508b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: pip install tox
- name: Setup server
run: |
tox --devenv venv-py312 -e py312-dj42
tox --devenv venv-py312 -e py312-dj50
source venv-py312/bin/activate
python dev/manage.py migrate
python dev/manage.py testdata
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ A global/site search modal for the Django admin.
## Requirements

- Python 3.7 - 3.12.
- Django 3.2 - 4.2.
- Django 3.2 - 5.0.

## Setup

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ classifiers =
Framework :: Django :: 4.0
Framework :: Django :: 4.1
Framework :: Django :: 4.2
Framework :: Django :: 5.0
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Expand Down
13 changes: 10 additions & 3 deletions tests/server/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@


def request_admin_content(
client: Client, view_name: str = "index", query_str: str = ""
client: Client,
view_name: str = "index",
query_str: str = "",
method: str = "get",
follow: bool = True,
) -> str:
"""Returns the response's content after GETing the admin site"""
response = client.get(f'{reverse(f"admin:{view_name}")}?{query_str}', follow=True)
path = reverse(f"admin:{view_name}")
response = getattr(client, method)(f"{path}?{query_str}", follow=follow)
return str(response.content)


Expand Down Expand Up @@ -71,7 +76,9 @@ def test_login(client_super_admin):

def test_logout(client_super_admin):
"""Verify that the elements are omitted from the logout page"""
content = request_admin_content(client_super_admin, "logout")
content = request_admin_content(
client_super_admin, "logout", method="post", follow=False
)

for element in ELEMENTS_CUSTOM:
assert element not in content
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ envlist =
{py38,py39,py310,py311,py312}-dj40
{py38,py39,py310,py311,py312}-dj41
{py38,py39,py310,py311,py312}-dj42
{py310,py311,py312}-dj50
playwright

[testenv]
Expand All @@ -24,6 +25,7 @@ deps =
dj40: django==4.0.*
dj41: django==4.1.*
dj42: django==4.2.*
dj50: django==5.0.*
description = run server/unit tests.
commands =
python -m pip freeze
Expand All @@ -34,7 +36,7 @@ setenv =
[testenv:playwright]
deps =
{[testenv]deps}
django==4.2.*
django==5.0.*
description = run Playwright browser tests (no need to do this for different py/dj versions).
commands =
python -m playwright install --with-deps
Expand Down

0 comments on commit b86508b

Please sign in to comment.