Skip to content

test(django-cf): add basic async handlers test for d1 and r2 - #199

Merged
ryanking13 merged 1 commit into
gyeongjae/django-cf-real-databasefrom
gyeongjae/django-cf-asgi-tests
Aug 13, 2026
Merged

test(django-cf): add basic async handlers test for d1 and r2#199
ryanking13 merged 1 commit into
gyeongjae/django-cf-real-databasefrom
gyeongjae/django-cf-asgi-tests

Conversation

@ryanking13

Copy link
Copy Markdown
Contributor

On top of #198.

Add basic test coverage of using d1, r2 backends with async handlers.

Comment thread packages/django-cf/tests/in_worker/worker/src/test_asgi_d1.py
@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown

I'm Bonk, and I've done a quick review of your PR.

This PR adds async (ASGI) test coverage for the D1 and R2 backends, with a shared _asgi_client.py helper, five D1 ORM tests exercising create/read/count/exists/update/iterate, and one R2 save-and-read test.

Issues found (1):

  1. test_asgi_d1_orm_async_iteration_returns_all_rows assertion masks order_by bugs (test_asgi_d1.py:156): The view applies .order_by("value") but the assertion wraps the result in sorted(), so it would pass even if ordering were broken. Posted as an inline suggestion.

github run

@ryanking13
ryanking13 merged commit 80e5e73 into main Aug 13, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants