diff --git a/core/views.py b/core/views.py
index f59c9ca..2b97f8f 100644
--- a/core/views.py
+++ b/core/views.py
@@ -285,7 +285,7 @@ def docs_rss_view(request: HttpRequest) -> HttpResponse:
return render(
request,
- "twitch/docs_rss.html",
+ "core/docs_rss.html",
{
"game": sample_game,
**seo_context,
@@ -432,7 +432,7 @@ def debug_view(request: HttpRequest) -> HttpResponse:
)
context.update(seo_context)
- return render(request, "twitch/debug.html", context)
+ return render(request, "core/debug.html", context)
# MARK: /datasets/
@@ -543,7 +543,7 @@ def dataset_backups_view(request: HttpRequest) -> HttpResponse:
"dataset_count": len(datasets),
**seo_context,
}
- return render(request, "twitch/dataset_backups.html", context)
+ return render(request, "core/dataset_backups.html", context)
def dataset_backup_download_view(
@@ -682,7 +682,7 @@ def search_view(request: HttpRequest) -> HttpResponse:
)
return render(
request,
- "twitch/search_results.html",
+ "core/search_results.html",
{"query": query, "results": results, **seo_context},
)
diff --git a/templates/twitch/dataset_backups.html b/templates/core/dataset_backups.html
similarity index 100%
rename from templates/twitch/dataset_backups.html
rename to templates/core/dataset_backups.html
diff --git a/templates/twitch/debug.html b/templates/core/debug.html
similarity index 100%
rename from templates/twitch/debug.html
rename to templates/core/debug.html
diff --git a/templates/twitch/docs_rss.html b/templates/core/docs_rss.html
similarity index 79%
rename from templates/twitch/docs_rss.html
rename to templates/core/docs_rss.html
index cec2dd7..41011a1 100644
--- a/templates/twitch/docs_rss.html
+++ b/templates/core/docs_rss.html
@@ -115,39 +115,41 @@
-
- Filtered RSS Feeds
- You can subscribe to RSS feeds scoped to a specific game.
-
-
+ {% if game %}
+
+ Filtered RSS Feeds
+ You can subscribe to RSS feeds scoped to a specific game.
+
+
+ {% endif %}
{% endblock content %}
diff --git a/templates/twitch/search_results.html b/templates/core/search_results.html
similarity index 100%
rename from templates/twitch/search_results.html
rename to templates/core/search_results.html
diff --git a/twitch/tests/test_views.py b/twitch/tests/test_views.py
index 7586914..5a9bec4 100644
--- a/twitch/tests/test_views.py
+++ b/twitch/tests/test_views.py
@@ -1006,14 +1006,29 @@ class TestChannelListView:
@pytest.mark.django_db
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"))
assert response.status_code == 200
- assert "feeds" in response.context
- assert "filtered_feeds" in response.context
- assert response.context["feeds"][0]["example_xml"]
- html: str = response.content.decode()
- assert '' in html
+
+ # Add Game with running campaign to ensure it's included in the RSS feed
+ game: Game = Game.objects.create(
+ twitch_id="g-rss",
+ 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