diff --git a/django/test/testcases.py b/django/test/testcases.py
index 276d1f3..10bd6c6 100644
a
|
b
|
class TransactionTestCase(unittest.TestCase):
|
347 | 347 | def assertContains(self, response, text, count=None, status_code=200, |
348 | 348 | msg_prefix=''): |
349 | 349 | """ |
350 | | Asserts that a response indicates that a page was retrieved |
| 350 | Asserts that a response indicates that some content was retrieved |
351 | 351 | successfully, (i.e., the HTTP status code was as expected), and that |
352 | 352 | ``text`` occurs ``count`` times in the content of the response. |
353 | 353 | If ``count`` is None, the count doesn't matter - the assertion is true |
… |
… |
class TransactionTestCase(unittest.TestCase):
|
357 | 357 | msg_prefix += ": " |
358 | 358 | |
359 | 359 | self.assertEqual(response.status_code, status_code, |
360 | | msg_prefix + "Couldn't retrieve page: Response code was %d" |
| 360 | msg_prefix + "Couldn't retrieve content: Response code was %d" |
361 | 361 | " (expected %d)" % (response.status_code, status_code)) |
362 | 362 | text = smart_str(text, response._charset) |
363 | 363 | real_count = response.content.count(text) |
… |
… |
class TransactionTestCase(unittest.TestCase):
|
372 | 372 | def assertNotContains(self, response, text, status_code=200, |
373 | 373 | msg_prefix=''): |
374 | 374 | """ |
375 | | Asserts that a response indicates that a page was retrieved |
| 375 | Asserts that a response indicates that some content was retrieved |
376 | 376 | successfully, (i.e., the HTTP status code was as expected), and that |
377 | 377 | ``text`` doesn't occurs in the content of the response. |
378 | 378 | """ |
… |
… |
class TransactionTestCase(unittest.TestCase):
|
380 | 380 | msg_prefix += ": " |
381 | 381 | |
382 | 382 | self.assertEqual(response.status_code, status_code, |
383 | | msg_prefix + "Couldn't retrieve page: Response code was %d" |
| 383 | msg_prefix + "Couldn't retrieve content: Response code was %d" |
384 | 384 | " (expected %d)" % (response.status_code, status_code)) |
385 | 385 | text = smart_str(text, response._charset) |
386 | 386 | self.assertEqual(response.content.count(text), 0, |
diff --git a/tests/regressiontests/test_client_regress/models.py b/tests/regressiontests/test_client_regress/models.py
index 6da7ae4..aca6097 100644
a
|
b
|
class AssertContainsTests(TestCase):
|
34 | 34 | try: |
35 | 35 | self.assertContains(response, 'text', status_code=999) |
36 | 36 | except AssertionError, e: |
37 | | self.assertEquals(str(e), "Couldn't retrieve page: Response code was 200 (expected 999)") |
| 37 | self.assertEquals(str(e), "Couldn't retrieve content: Response code was 200 (expected 999)") |
38 | 38 | try: |
39 | 39 | self.assertContains(response, 'text', status_code=999, msg_prefix='abc') |
40 | 40 | except AssertionError, e: |
41 | | self.assertEquals(str(e), "abc: Couldn't retrieve page: Response code was 200 (expected 999)") |
| 41 | self.assertEquals(str(e), "abc: Couldn't retrieve content: Response code was 200 (expected 999)") |
42 | 42 | |
43 | 43 | try: |
44 | 44 | self.assertNotContains(response, 'text', status_code=999) |
45 | 45 | except AssertionError, e: |
46 | | self.assertEquals(str(e), "Couldn't retrieve page: Response code was 200 (expected 999)") |
| 46 | self.assertEquals(str(e), "Couldn't retrieve content: Response code was 200 (expected 999)") |
47 | 47 | try: |
48 | 48 | self.assertNotContains(response, 'text', status_code=999, msg_prefix='abc') |
49 | 49 | except AssertionError, e: |
50 | | self.assertEquals(str(e), "abc: Couldn't retrieve page: Response code was 200 (expected 999)") |
| 50 | self.assertEquals(str(e), "abc: Couldn't retrieve content: Response code was 200 (expected 999)") |
51 | 51 | |
52 | 52 | try: |
53 | 53 | self.assertNotContains(response, 'once') |