Ticket #11253: 11253.diff
File 11253.diff, 2.2 KB (added by , 15 years ago) |
---|
-
docs/topics/testing.txt
139 139 its own test database. That is, any test that accesses a database -- by 140 140 creating and saving model instances, for example -- will not affect your 141 141 production database. However, the database is not refreshed between doctests, 142 so if your doctest requires a certain state you should consider flushin the 143 database or loading a fixture. (See the section on fixtures, below, for more 142 so if your doctest requires a certain state you should consider flushin the 143 database or loading a fixture. (See the section on fixtures, below, for more 144 144 on this.) Note that to use this feature, the database user Django is connecting 145 145 as must have ``CREATE DATABASE`` rights. 146 146 … … 1042 1042 Asserts that a ``Response`` instance produced the given ``status_code`` and 1043 1043 that ``text`` does not appears in the content of the response. 1044 1044 1045 .. method:: assertFormError(response, form, field, errors)1045 .. method:: TestCase.assertFormError(response, form, field, errors) 1046 1046 1047 1047 Asserts that a field on a form raises the provided list of errors when 1048 1048 rendered on the form. … … 1057 1057 ``errors`` is an error string, or a list of error strings, that are 1058 1058 expected as a result of form validation. 1059 1059 1060 .. method:: assertTemplateUsed(response, template_name)1060 .. method:: TestCase.assertTemplateUsed(response, template_name) 1061 1061 1062 1062 Asserts that the template with the given name was used in rendering the 1063 1063 response. 1064 1064 1065 1065 The name is a string such as ``'admin/index.html'``. 1066 1066 1067 .. method:: assertTemplateNotUsed(response, template_name)1067 .. method:: TestCase.assertTemplateNotUsed(response, template_name) 1068 1068 1069 1069 Asserts that the template with the given name was *not* used in rendering 1070 1070 the response. 1071 1071 1072 .. method:: assertRedirects(response, expected_url, status_code=302, target_status_code=200)1072 .. method:: TestCase.assertRedirects(response, expected_url, status_code=302, target_status_code=200) 1073 1073 1074 1074 Asserts that the response return a ``status_code`` redirect status, it 1075 1075 redirected to ``expected_url`` (including any GET data), and the final