More core templates to core template dir
All checks were successful
Deploy to Server / deploy (push) Successful in 12s

This commit is contained in:
Joakim Hellsén 2026-03-17 05:50:01 +01:00
commit 70298fdd1e
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
6 changed files with 61 additions and 44 deletions

View file

@ -285,7 +285,7 @@ def docs_rss_view(request: HttpRequest) -> HttpResponse:
return render( return render(
request, request,
"twitch/docs_rss.html", "core/docs_rss.html",
{ {
"game": sample_game, "game": sample_game,
**seo_context, **seo_context,
@ -432,7 +432,7 @@ def debug_view(request: HttpRequest) -> HttpResponse:
) )
context.update(seo_context) context.update(seo_context)
return render(request, "twitch/debug.html", context) return render(request, "core/debug.html", context)
# MARK: /datasets/ # MARK: /datasets/
@ -543,7 +543,7 @@ def dataset_backups_view(request: HttpRequest) -> HttpResponse:
"dataset_count": len(datasets), "dataset_count": len(datasets),
**seo_context, **seo_context,
} }
return render(request, "twitch/dataset_backups.html", context) return render(request, "core/dataset_backups.html", context)
def dataset_backup_download_view( def dataset_backup_download_view(
@ -682,7 +682,7 @@ def search_view(request: HttpRequest) -> HttpResponse:
) )
return render( return render(
request, request,
"twitch/search_results.html", "core/search_results.html",
{"query": query, "results": results, **seo_context}, {"query": query, "results": results, **seo_context},
) )

View file

@ -115,6 +115,7 @@
</tbody> </tbody>
</table> </table>
</section> </section>
{% if game %}
<section> <section>
<h2>Filtered RSS Feeds</h2> <h2>Filtered RSS Feeds</h2>
<p>You can subscribe to RSS feeds scoped to a specific game.</p> <p>You can subscribe to RSS feeds scoped to a specific game.</p>
@ -149,5 +150,6 @@
</tbody> </tbody>
</table> </table>
</section> </section>
{% endif %}
</main> </main>
{% endblock content %} {% endblock content %}

View file

@ -1006,14 +1006,29 @@ class TestChannelListView:
@pytest.mark.django_db @pytest.mark.django_db
def test_docs_rss_view(self, client: Client) -> None: def test_docs_rss_view(self, client: Client) -> None:
"""Test docs RSS view returns 200 and has feeds in context.""" """Test docs RSS view returns 200."""
response: _MonkeyPatchedWSGIResponse = client.get(reverse("core:docs_rss")) response: _MonkeyPatchedWSGIResponse = client.get(reverse("core:docs_rss"))
assert response.status_code == 200 assert response.status_code == 200
assert "feeds" in response.context
assert "filtered_feeds" in response.context # Add Game with running campaign to ensure it's included in the RSS feed
assert response.context["feeds"][0]["example_xml"] game: Game = Game.objects.create(
html: str = response.content.decode() twitch_id="g-rss",
assert '<code class="language-xml">' in html name="Game RSS",
display_name="Game RSS",
)
DropCampaign.objects.create(
twitch_id="c-rss",
name="Campaign RSS",
game=game,
start_at=timezone.now() - timedelta(days=1),
end_at=timezone.now() + timedelta(days=1),
operation_names=["DropCampaignDetails"],
)
response = client.get(reverse("core:docs_rss"))
assert response.status_code == 200
assert "g-rss" in response.content.decode("utf-8")
@pytest.mark.django_db @pytest.mark.django_db