Ticket #20177: 20177.diff

File 20177.diff, 2.3 KB (added by Tim Graham, 12 years ago)
  • docs/intro/tutorial05.txt

    diff --git a/docs/intro/tutorial05.txt b/docs/intro/tutorial05.txt
    index 3b0a95f..261a503 100644
    a b in the shell::  
    326326    >>> from django.test.utils import setup_test_environment
    327327    >>> setup_test_environment()
    328328
     329:meth:`~django.test.utils.setup_test_environment` installs a template renderer
     330which will allow us to examine some additional attributes on responses such as
     331``response.context`` that otherwise wouldn't be available. Note that this
     332method *does not* setup a test database, so the following will be run against
     333the existing database and the output may differ slightly depending on what
     334polls you already created.
     335
    329336Next we need to import the test client class (later in ``tests.py`` we will use
    330337the :class:`django.test.TestCase` class, which comes with its own client, so
    331338this won't be required)::
  • docs/topics/testing/advanced.txt

    diff --git a/docs/topics/testing/advanced.txt b/docs/topics/testing/advanced.txt
    index 26dc8ee..5495542 100644
    a b environment first. Django provides a convenience method to do this::  
    163163    >>> from django.test.utils import setup_test_environment
    164164    >>> setup_test_environment()
    165165
    166 This convenience method sets up the test database, and puts other
    167 Django features into modes that allow for repeatable testing.
     166:func:`~django.test.utils.setup_test_environment` puts several Django features
     167into modes that allow for repeatable testing, but does not create the test
     168databases; :func:`django.test.simple.DjangoTestSuiteRunner.setup_databases`
     169takes care of that.
    168170
    169 The call to :meth:`~django.test.utils.setup_test_environment` is made
     171The call to :func:`~django.test.utils.setup_test_environment` is made
    170172automatically as part of the setup of ``./manage.py test``. You only
    171173need to manually invoke this method if you're not using running your
    172174tests via Django's test runner.
    Methods  
    282284
    283285.. method:: DjangoTestSuiteRunner.setup_test_environment(**kwargs)
    284286
    285     Sets up the test environment ready for testing.
     287    Sets up the test environment by calling
     288    :func:`~django.test.utils.setup_test_environment` and setting
     289    :setting:`DEBUG` to ``False``.
    286290
    287291.. method:: DjangoTestSuiteRunner.build_suite(test_labels, extra_tests=None, **kwargs)
    288292
Back to Top