diff --git a/lms/djangoapps/teams/api_urls.py b/lms/djangoapps/teams/api_urls.py index f27f0af8af..0d71c78567 100644 --- a/lms/djangoapps/teams/api_urls.py +++ b/lms/djangoapps/teams/api_urls.py @@ -14,7 +14,7 @@ from .views import ( TEAM_ID_PATTERN = r'(?P[a-z\d_-]+)' USERNAME_PATTERN = r'(?P[\w.+-]+)' -TOPIC_ID_PATTERN = TEAM_ID_PATTERN.replace('team_id', 'topic_id') +TOPIC_ID_PATTERN = r'(?P[A-Za-z\d_.-]+)' urlpatterns = patterns( '', diff --git a/lms/djangoapps/teams/tests/test_views.py b/lms/djangoapps/teams/tests/test_views.py index f2c946f96c..4f0673103e 100644 --- a/lms/djangoapps/teams/tests/test_views.py +++ b/lms/djangoapps/teams/tests/test_views.py @@ -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)