Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Corrige le problème d'encodage dans l'historique d'un contenu (#4826)
Corrige le problème d'encodage dans l'historique d'un contenu et ajoute des tests also Fix templatetag
- Loading branch information
Showing
2 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.test import TestCase | ||
|
||
from zds.utils.templatetags.htmldiff import htmldiff | ||
|
||
|
||
class HtmlDiffTests(TestCase): | ||
|
||
def test_empty(self): | ||
self.assertEquals(htmldiff('essai'.encode(), 'essai'.encode()), '<p>Pas de changements.</p>') | ||
|
||
def test_nominal(self): | ||
self.assertIn('Agrume', htmldiff('Agrume'.encode(), ''.encode())) | ||
|
||
def test_encoding(self): | ||
# Regression test for issue #4824 | ||
self.assertIn('Étrange caractère', htmldiff('Étrange caractère'.encode(), ''.encode())) |