Skip to content

Commit

Permalink
Speed up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger committed Dec 29, 2024
1 parent fe6fe38 commit 91587da
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ jobs:
run: pip install --upgrade pip hatch uv
- name: Run Single DB Tests
run: hatch test --python ${{ matrix.python-version }} --ds=test_app.settings_single_db -v

python-source-multi-db:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python Dependencies
run: pip install --upgrade pip hatch uv
- name: Run Multi-DB Tests
run: hatch test --python ${{ matrix.python-version }} --ds=test_app.settings_multi_db -v

Expand Down
3 changes: 0 additions & 3 deletions src/reactpy_django/templatetags/reactpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ def component(
_logger.error(msg)
return failure_context(dotted_path, ComponentCarrierError(msg))

# Call `dir` before prerendering to make sure the user object is loaded
dir(request.user)

_prerender_html = prerender_component(user_component, args, kwargs, uuid, request)

# Fetch the offline component's HTML, if requested
Expand Down
1 change: 1 addition & 0 deletions src/reactpy_django/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ def prerender_component(
search = request.GET.urlencode()
scope = getattr(request, "scope", {})
scope["reactpy"] = {"id": str(uuid)}
dir(request.user) # Call `dir` before prerendering to make sure the user object is loaded

with SyncLayout(
ConnectionContext(
Expand Down

0 comments on commit 91587da

Please sign in to comment.