Fix course_id string.
This commit is contained in:
Awais Qureshi
2020-03-31 23:48:37 +05:00
parent d8774e4f8d
commit 30a2ae8aec
2 changed files with 12 additions and 5 deletions

View File

@@ -63,13 +63,17 @@ class ReceiptViewTests(UserMixin, ModuleStoreTestCase):
"""
# Enroll as verified in the course with the current user.
CourseEnrollment.enroll(self.user, self.course.id, mode=CourseMode.VERIFIED)
response = self.client.get(reverse('commerce:user_verification_status'), data={'course_id': self.course.id})
response = self.client.get(
reverse('commerce:user_verification_status'), data={'course_id': str(self.course.id)}
)
json_data = json.loads(response.content.decode('utf-8'))
self.assertEqual(json_data['is_verification_required'], True)
# Enroll as honor in the course with the current user.
CourseEnrollment.enroll(self.user, self.course.id, mode=CourseMode.HONOR)
response = self.client.get(reverse('commerce:user_verification_status'), data={'course_id': self.course.id})
response = self.client.get(
reverse('commerce:user_verification_status'), data={'course_id': str(self.course.id)}
)
json_data = json.loads(response.content.decode('utf-8'))
self.assertEqual(json_data['is_verification_required'], False)