COVERAGE: patch 91% → 96%+ — 603 tests, tasks.py at 100%
New/extended tests across billboard, dashboard, drama, epic, gameboard, and lyric to cover previously untested branches: dev_login view, scroll position endpoints, sky preview error paths, drama to_prose/to_activity branches, consumer broadcast handlers, tarot deck draw/shuffle, astrology model __str__, character model, sig reserve/ready/confirm views, natus preview/save views, and the full tasks.py countdown scheduler. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -85,3 +85,25 @@ class LoginViewTest(TestCase):
|
||||
mock_auth.authenticate.call_args,
|
||||
mock.call(uid="abc123")
|
||||
)
|
||||
|
||||
|
||||
class DevLoginViewTest(TestCase):
|
||||
def test_happy_path_sets_session_cookie_and_redirects(self):
|
||||
from django.test import override_settings
|
||||
with override_settings(DEBUG=True):
|
||||
response = self.client.get("/lyric/dev-login/testsessionkey/")
|
||||
self.assertEqual(response.status_code, 302)
|
||||
self.assertEqual(response["Location"], "/")
|
||||
self.assertIn("sessionid", response.cookies)
|
||||
|
||||
def test_next_param_sets_redirect_target(self):
|
||||
from django.test import override_settings
|
||||
with override_settings(DEBUG=True):
|
||||
response = self.client.get("/lyric/dev-login/key/?next=/gameboard/")
|
||||
self.assertEqual(response["Location"], "/gameboard/")
|
||||
|
||||
def test_returns_404_when_debug_is_false(self):
|
||||
from django.test import override_settings
|
||||
with override_settings(DEBUG=False):
|
||||
response = self.client.get("/lyric/dev-login/key/")
|
||||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
Reference in New Issue
Block a user