Ticket #21687: 0001-Added-a-topic-on-testing-abstract-models.patch

File 0001-Added-a-topic-on-testing-abstract-models.patch, 1.3 KB (added by JocelynD, 11 years ago)

documentation edit proposal (master)

  • docs/topics/testing/advanced.txt

    From 5c603da8ef19acc342cf6da11e4a7c5e0985f81b Mon Sep 17 00:00:00 2001
    From: Jocelyn Delande <jocelyn at delalande dot fr>
    Date: Sun, 2 Feb 2014 00:56:10 +0100
    Subject: [PATCH] Added a topic on testing abstract models
    
    ---
     docs/topics/testing/advanced.txt |   16 ++++++++++++++++
     1 file changed, 16 insertions(+)
    
    diff --git a/docs/topics/testing/advanced.txt b/docs/topics/testing/advanced.txt
    index cbf574a..fd863b6 100644
    a b If there are any circular dependencies in the  
    161161:setting:`TEST_DEPENDENCIES` definition, an ``ImproperlyConfigured``
    162162exception will be raised.
    163163
     164
     165.. _topics-testing-abstract-models:
     166
     167Testing Abstract models
     168=======================
     169
     170Django apps providing :ref:`abstract models <abstract-base-classes>` as reusable
     171components  may need to test them by creating a *stub* child class for testing
     172purposes only.
     173
     174As you don't want to put testing-only models inside your :file:`models.py`,
     175you can write them within the related test file (eg: :file:`myapp/tests.py`).
     176They will be picked-up by the ORM at test-time and related tables will be
     177created in the :ref:`the-test-database`.
     178
     179
    164180Advanced features of ``TransactionTestCase``
    165181============================================
    166182
Back to Top