Merge pull request #991 from bookwyrm-social/character-encoding

Fixes character encoding bug
This commit is contained in:
Mouse Reeve 2021-04-23 12:06:04 -07:00 committed by GitHub
commit cbdf573261
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -1,10 +1,10 @@
{% load i18n %}
{% if rating %}
{% blocktrans with book_title=book.title display_rating=rating|floatformat:"0" review_title=name count counter=rating %}Review of "{{ book_title }}" ({{ display_rating }} star): {{ review_title }}{% plural %}Review of "{{ book_title }}" ({{ display_rating }} stars): {{ review_title }}{% endblocktrans %}
{% blocktrans with book_title=book.title|safe display_rating=rating|floatformat:"0" review_title=name|safe count counter=rating %}Review of "{{ book_title }}" ({{ display_rating }} star): {{ review_title }}{% plural %}Review of "{{ book_title }}" ({{ display_rating }} stars): {{ review_title }}{% endblocktrans %}
{% else %}
{% blocktrans with book_title=book.title review_title=name %}Review of "{{ book_title }}": {{ review_title }}{% endblocktrans %}
{% blocktrans with book_title=book.title|safe review_title=name|safe %}Review of "{{ book_title }}": {{ review_title }}{% endblocktrans %}
{% endif %}

View file

@ -269,7 +269,7 @@ class Status(TestCase):
def test_review_to_pure_activity(self, *_):
""" subclass of the base model version with a "pure" serializer """
status = models.Review.objects.create(
name="Review name",
name="Review's name",
content="test content",
rating=3.0,
user=self.local_user,
@ -280,7 +280,7 @@ class Status(TestCase):
self.assertEqual(activity["type"], "Article")
self.assertEqual(
activity["name"],
'Review of "%s" (3 stars): Review name' % self.book.title,
'Review of "%s" (3 stars): Review\'s name' % self.book.title,
)
self.assertEqual(activity["content"], "test content")
self.assertEqual(activity["attachment"][0].type, "Document")