summaryrefslogtreecommitdiff
path: root/docs/howto
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-01-18 16:43:01 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-01-18 16:43:01 +0000
commitb31a1b99261d05bf8a34495ee9faf4d6592b8b36 (patch)
treef4064ac0d7e287596458823a67e7f75ea0ddd444 /docs/howto
parent5502fa59801c70094b6a2e789ece65aa7b31b58c (diff)
Refs #14661 -- Clarified the handling of initial data injected via custom SQL.
This is BACKWARDS INCOMPATIBLE CHANGE for anyone relying on SQL-injected initial data in a test case. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15239 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/howto')
-rw-r--r--docs/howto/initial-data.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/howto/initial-data.txt b/docs/howto/initial-data.txt
index cf3f65d299..dd6a099b9d 100644
--- a/docs/howto/initial-data.txt
+++ b/docs/howto/initial-data.txt
@@ -121,6 +121,17 @@ the order in which they're executed. The only thing you can assume is
that, by the time your custom data files are executed, all the
database tables already will have been created.
+.. admonition:: Initial SQL data and testing
+
+ This technique *cannot* be used to provide initial data for
+ testing purposes. Django's test framework flushes the contents of
+ the test database after each test; as a result, any data added
+ using the custom SQL hook will be lost.
+
+ If you require data for a test case, you should add it using
+ either a :ref:`test fixture <topics-testing-fixtures>`, or
+ programatically add it during the ``setUp()`` of your test case.
+
Database-backend-specific SQL data
----------------------------------