summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJeremy Dunck <jdunck@gmail.com>2012-09-18 20:58:40 +0200
committerClaude Paroz <claude@2xlibre.net>2012-09-18 21:05:41 +0200
commit40e62a5ccd08f241e977c9ffcb96005b9f2d95e6 (patch)
tree3a31d144988509afa74ff43f56b2071ba516b15c /tests
parent319e1355190d414ee1b095b26fbb494cf9a27578 (diff)
Fixed #18980 -- Fixed assertContains regression when passed an object
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/test_client_regress/tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/regressiontests/test_client_regress/tests.py b/tests/regressiontests/test_client_regress/tests.py
index d80293b358..9deb8a4755 100644
--- a/tests/regressiontests/test_client_regress/tests.py
+++ b/tests/regressiontests/test_client_regress/tests.py
@@ -16,6 +16,7 @@ from django.test import Client, TestCase
from django.test.client import encode_file, RequestFactory
from django.test.utils import ContextList, override_settings, str_prefix
from django.template.response import SimpleTemplateResponse
+from django.utils.translation import ugettext_lazy
from django.http import HttpResponse
@@ -129,6 +130,14 @@ class AssertContainsTests(TestCase):
self.assertNotContains(r, 'はたけ')
self.assertNotContains(r, b'\xe3\x81\xaf\xe3\x81\x9f\xe3\x81\x91'.decode('utf-8'))
+ def test_nontext_contains(self):
+ r = self.client.get('/test_client_regress/no_template_view/')
+ self.assertContains(r, ugettext_lazy('once'))
+
+ def test_nontext_not_contains(self):
+ r = self.client.get('/test_client_regress/no_template_view/')
+ self.assertNotContains(r, ugettext_lazy('never'))
+
def test_assert_contains_renders_template_response(self):
""" Test that we can pass in an unrendered SimpleTemplateReponse
without throwing an error.