Skip to content

Commit

Permalink
Fixed the issues with new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rutvikrj26 committed May 1, 2024
1 parent 4e22fce commit 491519e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions physionet-django/training/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def test_take_training_post_redirect_valid(self):
response = self.client.post(reverse("start_training"), {"training_type": 2})
self.assertRedirects(response, reverse(
"platform_training",
kwargs={'training_slug': "world-101-introduction-to-continents-and-countries"}),status_code=302)
kwargs={'training_slug': "world-101-introduction-to-continents-and-countries"}), status_code=302)

def test_create_course_get(self):
"""test if admin can access the courses page"""
Expand Down Expand Up @@ -250,18 +250,24 @@ def test_update_course_post_valid(self):
def test_current_module_block(self):
"""test if the current module block page loads"""

response = self.client.get(reverse("platform_training_module_block", kwargs={'training_slug': "world-101-introduction-to-continents-and-countries", 'module_id': 1, 'order': 1}))
response = self.client.get(reverse("platform_training_module_block", kwargs={
'training_slug': "world-101-introduction-to-continents-and-countries",
'module_id': 1, 'order': 1}))
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "training/course_block.html")

def test_next_module_block(self):
"""test if the next module block page loads"""

response = self.client.get(reverse("next_module_block", kwargs={'training_slug': "world-101-introduction-to-continents-and-countries", 'module_id': 1, 'order': 1}))
response = self.client.get(reverse("next_module_block", kwargs={
'training_slug': "world-101-introduction-to-continents-and-countries",
'module_id': 1, 'order': 1}))
self.assertEqual(response.status_code, 302)

def test_previous_module_block(self):
"""test if the previous module block page loads"""

response = self.client.get(reverse("previous_module_block", kwargs={'training_slug': "world-101-introduction-to-continents-and-countries", 'module_id': 1, 'order': 1}))
response = self.client.get(reverse("previous_module_block", kwargs={
'training_slug': "world-101-introduction-to-continents-and-countries",
'module_id': 1, 'order': 1}))
self.assertEqual(response.status_code, 302)

0 comments on commit 491519e

Please sign in to comment.