mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #20237 -- Reenabled assertContains with binary parameter
Thanks Baptiste Mispelon for the review.
This commit is contained in:
parent
c852d45681
commit
fe01404bb9
4 changed files with 22 additions and 4 deletions
|
@ -131,6 +131,13 @@ class AssertContainsTests(TestCase):
|
|||
self.assertNotContains(r, 'はたけ')
|
||||
self.assertNotContains(r, b'\xe3\x81\xaf\xe3\x81\x9f\xe3\x81\x91'.decode('utf-8'))
|
||||
|
||||
def test_binary_contains(self):
|
||||
r = self.client.get('/test_client_regress/check_binary/')
|
||||
self.assertContains(r, b'PDF document')
|
||||
with self.assertRaises(AssertionError):
|
||||
self.assertContains(r, b'PDF document', count=2)
|
||||
self.assertNotContains(r, b'ODF document')
|
||||
|
||||
def test_nontext_contains(self):
|
||||
r = self.client.get('/test_client_regress/no_template_view/')
|
||||
self.assertContains(r, ugettext_lazy('once'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue