Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

ddt : double-dump test

pm ddt

Run a double dump test on this site.

double dump test

A test that consists in doing a first pm dump2py, restoring the database from this restore.py, then doing a second pm dump2py, and finally verifying whether both dumps are exactly the same.

Options:

--batch

Do not prompt for user input of any kind.

--noinput

Alias for --batch

This page contains code snippets (lines starting with >>>), which are being tested during our development workflow. The following snippet initializes the demo project used throughout this page.

>>> from lino_book.projects.cosi4.startup import *
>>> from atelier.sheller import Sheller
>>> shell = Sheller(settings.SITE.project_dir)
>>> assert (shell.cwd / 'manage.py').exists()
>>> shell("django-admin ddt --help")
...
usage: django-admin ddt [-h] [-b] [--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color]
                        [--force-color] [--skip-checks]

Run a double-dump test on this site.

options:
  -h, --help            show this help message and exit
  -b, --batch, --noinput
                        Do not prompt for input of any kind.
  --version             Show program's version number and exit.
  -v {0,1,2,3}, --verbosity {0,1,2,3}
                        Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output
  --settings SETTINGS   The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the
                        DJANGO_SETTINGS_MODULE environment variable will be used.
  --pythonpath PYTHONPATH
                        A directory to add to the Python path, e.g. "/home/djangoprojects/myproject".
  --traceback           Display a full stack trace on CommandError exceptions.
  --no-color            Don't colorize the command output.
  --force-color         Force colorization of the command output.
  --skip-checks         Skip system checks.
>>> shell("django-admin ddt -b")
...
Writing /.../cosi4/tmp/a/restore.py...
Wrote 833 objects to /.../projects/cosi4/tmp/a/restore.py and siblings.
...
Loaded 833 objects
Writing /.../cosi4/tmp/b/restore.py...
...
Successfully ran double-dump test in .../cosi4/tmp.