def install_fixtures(self): """If the Test Case class has a 'fixtures' member, clear the database and install the named fixtures at the start of each test. """ management.flush(verbosity=0, interactive=False) if hasattr(self, 'fixtures'): management.load_data(self.fixtures, verbosity=0)
def v096_command(*args): """Clears the current datastore and loads the initial fixture data. """ # This wrapper function is used instead of passing the real function directly # to Django because Django 0.96 wants to read its docstring and args # attribute for commandline help. from django.db import connection connection.flush() from django.core.management import load_data load_data(['initial_data'])
def _pre_setup(self): """Perform any pre-test setup. This includes: * If the Test Case class has a 'fixtures' member, clearing the database and installing the named fixtures at the start of each test. * Clearing the mail test outbox. """ management.flush(verbosity=0, interactive=False) if hasattr(self, 'fixtures'): management.load_data(self.fixtures, verbosity=0) mail.outbox = []