@@ -85,6 +85,7 @@ def setUp(self):
8585 self .client .login (username = "testuser" , password = "testpass123" )
8686 # Clear cache before each test to avoid interference
8787 from django .core .cache import cache
88+
8889 cache .clear ()
8990
9091 def test_missing_youtube_link (self ):
@@ -109,11 +110,16 @@ def test_invalid_url_format(self):
109110
110111 @patch ("note_generator.transcript_utils.get_transcript_with_diagnostics" )
111112 @patch ("note_generator.views.yt_title" )
112- def test_transcript_fetch_403_blocked (self , mock_yt_title , mock_get_transcript_diag ):
113+ def test_transcript_fetch_403_blocked (
114+ self , mock_yt_title , mock_get_transcript_diag
115+ ):
113116 """Simulate YouTube blocking with HTTP 403."""
114117 mock_yt_title .return_value = "Test Video"
115118 # Mock the diagnostics function to return error
116- mock_get_transcript_diag .return_value = (None , YouTubeBlockedError ("HTTP 403 Forbidden" ))
119+ mock_get_transcript_diag .return_value = (
120+ None ,
121+ YouTubeBlockedError ("HTTP 403 Forbidden" ),
122+ )
117123
118124 response = self .client .post (
119125 "/generate-notes" ,
@@ -133,7 +139,10 @@ def test_transcript_fetch_429_rate_limited(
133139 ):
134140 """Simulate rate limiting with HTTP 429."""
135141 mock_yt_title .return_value = "Test Video"
136- mock_get_transcript_diag .return_value = (None , YouTubeBlockedError ("HTTP 429 Too Many Requests" ))
142+ mock_get_transcript_diag .return_value = (
143+ None ,
144+ YouTubeBlockedError ("HTTP 429 Too Many Requests" ),
145+ )
137146
138147 response = self .client .post (
139148 "/generate-notes" ,
0 commit comments