Skip to content

Commit

Permalink
chore: what is wrong with these tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonHBodine committed Sep 7, 2023
1 parent 3a37b2c commit a4bd227
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions edxval/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,26 +1112,23 @@ def setUp(self):
"""
Tests setup.
"""

self.url_base = 'course-transcripts'
self.base_url = 'i-hate-you'
super().setUp()

def test_good_request_responses(self):
url = reverse(
self.url_base,
kwargs={"course_id": 'course-v1:edx+1+2023_05'}
)
"""
Test response when the request is correct.
"""
url = reverse(self.base_url, kwargs={'course_id': 'course-v1:edx+1+2023_05'})
print(url)
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_200_OK)

def test_bad_request_responses(self):
"""
Tests error responses occurred during GET.
Tests error responses.
"""
url = reverse(
self.url_base,
kwargs={"course_id": 'not-real-course'}
)
url = reverse(self.base_url, kwargs={"blah": 'not-real-course'})
response = self.client.get(url)

self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
2 changes: 1 addition & 1 deletion edxval/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
name='hls-missing-video'
),
path('videos/course-transcripts/<str:course_id>/', views.CourseTranscriptsDetailView.as_view(),
name='course-transcripts'
name='i-hate-you'
),
path('videos/video-transcripts/create/', views.VideoTranscriptView.as_view(),
name='create-video-transcript'
Expand Down

0 comments on commit a4bd227

Please sign in to comment.