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
419
419
420
420
You can replace the :fixture: `django_db_setup ` fixture and run any code in its
421
421
place. 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
424
424
invoke the ``psql `` or the ``mysql `` command line tool.
425
425
426
426
Put this in ``conftest.py ``::
@@ -439,6 +439,11 @@ Put this in ``conftest.py``::
439
439
INSERT INTO theapp_item (name) VALUES ('created from a sql script');
440
440
''')
441
441
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
+
442
447
443
448
Use a read only database
444
449
""""""""""""""""""""""""
You can’t perform that action at this time.
0 commit comments