Ticket #11253: 11253.diff

File 11253.diff, 2.2 KB (added by Chris Beaven, 15 years ago)
  • docs/topics/testing.txt

     
    139139its own test database. That is, any test that accesses a database -- by
    140140creating and saving model instances, for example -- will not affect your
    141141production 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 
     142so if your doctest requires a certain state you should consider flushin the
     143database or loading a fixture. (See the section on fixtures, below, for more
    144144on this.) Note that to use this feature, the database user Django is connecting
    145145as must have ``CREATE DATABASE`` rights.
    146146
     
    10421042    Asserts that a ``Response`` instance produced the given ``status_code`` and
    10431043    that ``text`` does not appears in the content of the response.
    10441044
    1045 .. method:: assertFormError(response, form, field, errors)
     1045.. method:: TestCase.assertFormError(response, form, field, errors)
    10461046
    10471047    Asserts that a field on a form raises the provided list of errors when
    10481048    rendered on the form.
     
    10571057    ``errors`` is an error string, or a list of error strings, that are
    10581058    expected as a result of form validation.
    10591059
    1060 .. method:: assertTemplateUsed(response, template_name)
     1060.. method:: TestCase.assertTemplateUsed(response, template_name)
    10611061
    10621062    Asserts that the template with the given name was used in rendering the
    10631063    response.
    10641064
    10651065    The name is a string such as ``'admin/index.html'``.
    10661066
    1067 .. method:: assertTemplateNotUsed(response, template_name)
     1067.. method:: TestCase.assertTemplateNotUsed(response, template_name)
    10681068
    10691069    Asserts that the template with the given name was *not* used in rendering
    10701070    the response.
    10711071
    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)
    10731073
    10741074    Asserts that the response return a ``status_code`` redirect status, it
    10751075    redirected to ``expected_url`` (including any GET data), and the final
Back to Top