diff --git a/src/olympia/ratings/serializers.py b/src/olympia/ratings/serializers.py index 29a9841c5897..4aa53184a6ec 100644 --- a/src/olympia/ratings/serializers.py +++ b/src/olympia/ratings/serializers.py @@ -184,7 +184,6 @@ class RatingSerializerReply(BaseRatingSerializer): allow_null=False, required=True, allow_blank=False, - validators=[NoURLsValidator()], ) def to_representation(self, obj): diff --git a/src/olympia/ratings/tests/test_views.py b/src/olympia/ratings/tests/test_views.py index 5529a401f51b..764c0e7a6fb2 100644 --- a/src/olympia/ratings/tests/test_views.py +++ b/src/olympia/ratings/tests/test_views.py @@ -3034,6 +3034,25 @@ def test_reply(self): assert len(mail.outbox) == 1 + def test_reply_allows_urls(self): + self.addon_author = user_factory() + self.addon.addonuser_set.create(user=self.addon_author) + self.client.login_api(self.addon_author) + response = self.client.post( + self.url, + data={ + 'body': 'My réply... https://example.com is nice.', + }, + ) + assert response.status_code == 201 + review = Rating.objects.latest('pk') + assert review.pk == response.data['id'] + assert ( + review.body + == response.data['body'] + == 'My réply... https://example.com is nice.' + ) + def test_reply_if_a_reply_already_exists_updates_existing(self): self.addon_author = user_factory() self.addon.addonuser_set.create(user=self.addon_author)