Skip to content

Commit

Permalink
chore: remove out of date comments for code that is no longer experim…
Browse files Browse the repository at this point in the history
…ental (#3056)
  • Loading branch information
Rebecca Graber authored Jun 21, 2021
1 parent b9d4828 commit 1593dcd
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 10 deletions.
2 changes: 0 additions & 2 deletions course_discovery/apps/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,6 @@ class Meta(CourseSerializer.Meta):
)


# Experiment WS-1681: Course recommendations
class CourseWithRecommendationsSerializer(DynamicFieldsMixin, TimestampModelSerializer):
uuid = UUIDField(read_only=True, default=CreateOnlyDefault(uuid4))
recommendations = serializers.SerializerMethodField()
Expand Down Expand Up @@ -1262,7 +1261,6 @@ class Meta(CourseSerializer.Meta):
model = Course
fields = ('key', 'uuid', 'title', 'owners', 'image',
'short_description', 'type', 'url_slug', 'course_run_keys', 'marketing_url')
# end experiment code


class CatalogCourseSerializer(CourseSerializer):
Expand Down
2 changes: 0 additions & 2 deletions course_discovery/apps/api/tests/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2572,7 +2572,6 @@ def test_data(self):
self.assertDictEqual(serializer.data, expected)


# Experiment WS-1681: course recommendations
class CourseRecommendationSerializerTests(MinimalCourseSerializerTests):
serializer_class = CourseRecommendationSerializer

Expand Down Expand Up @@ -2656,4 +2655,3 @@ def test_exclude_utm(self):
SeatFactory.create_batch(2, course_run=course_run)
serializer = self.serializer_class(course_with_recs, context={'request': request, 'exclude_utm': 1})
assert serializer.data['recommendations'][0]['marketing_url'] == recommended_course_0.marketing_url
# end experiment code
2 changes: 0 additions & 2 deletions course_discovery/apps/api/v1/tests/test_views/test_courses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1576,10 +1576,8 @@ def test_html_restricted(self):
response = self.client.patch(url, {'full_description': '<h1>Header</h1>'}, format='json')
self.assertContains(response, 'Invalid HTML received: h1 tag is not allowed', status_code=400)

# Experiment WS-1681: course recommendations
@responses.activate
def test_recommendations(self):
url = reverse('api:v1:course_recommendations-detail', kwargs={'key': self.course.key})
response = self.client.get(url)
assert response.status_code == 200
# end experiment code
1 change: 0 additions & 1 deletion course_discovery/apps/api/v1/views/courses.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ def retrieve(self, request, *args, **kwargs):
return super().retrieve(request, *args, **kwargs)


# Experiment WS-1681: Course recommendations
class CourseRecommendationViewSet(RetrieveModelMixin, viewsets.GenericViewSet):
filter_backends = (DjangoFilterBackend, )
lookup_field = 'key'
Expand Down
2 changes: 0 additions & 2 deletions course_discovery/apps/course_metadata/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,6 @@ def advertised_course_run(self):

return advertised_course_run

# Experiment WS-1681: Course recommendations
def has_marketable_run(self):
return any(run.is_marketable for run in self.course_runs.all())

Expand Down Expand Up @@ -1176,7 +1175,6 @@ def recommendations(self):
deduped.append(course)
seen.add(course)
return deduped
# End Experiment WS-1681: Course recommendations


class CourseEditor(TimeStampedModel):
Expand Down
1 change: 0 additions & 1 deletion course_discovery/apps/course_metadata/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2408,7 +2408,6 @@ def test_slug_with_partner_mismatch(self):
url_slug=slug_object.url_slug)]


# Experiment WS-1681: Course recommendations
class TestCourseRecommendations(TestCase):
def setUp(self):
super().setUp()
Expand Down

0 comments on commit 1593dcd

Please sign in to comment.