File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -419,8 +419,8 @@ Create the test database from a custom SQL script
419419
420420You can replace the :fixture: `django_db_setup ` fixture and run any code in its
421421place. This includes creating your database by hand by running a SQL script
422- directly. This example shows how sqlite3's executescript method. In more a more
423- general use cases you probably want to load the SQL statements from a file or
422+ directly. This example shows sqlite3's executescript method. In a more
423+ general use case, you probably want to load the SQL statements from a file or
424424invoke the ``psql `` or the ``mysql `` command line tool.
425425
426426Put this in ``conftest.py ``::
@@ -439,6 +439,11 @@ Put this in ``conftest.py``::
439439 INSERT INTO theapp_item (name) VALUES ('created from a sql script');
440440 ''')
441441
442+ .. warning ::
443+ This snippet shows ``cursor().executescript() `` which is `sqlite ` specific, for
444+ other database engines this method might differ. For instance, psycopg2 uses
445+ ``cursor().execute() ``.
446+
442447
443448Use a read only database
444449""""""""""""""""""""""""
You can’t perform that action at this time.
0 commit comments