Merge pull request #11624 from edx/mrehan/topic-not-found-tnl-4136
TNL-4136 fix topic detail endpoint's url to support alphanumeric and period characters in topic ID
This commit is contained in:
@@ -14,7 +14,7 @@ from .views import (
|
||||
|
||||
TEAM_ID_PATTERN = r'(?P<team_id>[a-z\d_-]+)'
|
||||
USERNAME_PATTERN = r'(?P<username>[\w.+-]+)'
|
||||
TOPIC_ID_PATTERN = TEAM_ID_PATTERN.replace('team_id', 'topic_id')
|
||||
TOPIC_ID_PATTERN = r'(?P<topic_id>[A-Za-z\d_.-]+)'
|
||||
|
||||
urlpatterns = patterns(
|
||||
'',
|
||||
|
||||
@@ -231,6 +231,11 @@ class TeamAPITestCase(APITestCase, SharedModuleStoreTestCase):
|
||||
'name': 'Public Profiles',
|
||||
'description': 'Description for topic 6.'
|
||||
},
|
||||
{
|
||||
'id': 'Topic_6.5',
|
||||
'name': 'Test Accessibility Topic',
|
||||
'description': 'Description for Topic_6.5'
|
||||
},
|
||||
],
|
||||
'max_team_size': 1
|
||||
}
|
||||
@@ -1193,6 +1198,9 @@ class TestDetailTopicAPI(TeamAPITestCase):
|
||||
def test_invalid_topic_id(self):
|
||||
self.get_topic_detail('no_such_topic', self.test_course_1.id, 404)
|
||||
|
||||
def test_topic_detail_with_caps_and_dot_in_id(self):
|
||||
self.get_topic_detail('Topic_6.5', self.test_course_2.id, user='student_enrolled_public_profile')
|
||||
|
||||
def test_team_count(self):
|
||||
"""Test that team_count is included with a topic"""
|
||||
topic = self.get_topic_detail(topic_id='topic_0', course_id=self.test_course_1.id)
|
||||
|
||||
Reference in New Issue
Block a user