コード例 #1
0
ファイル: testcases.py プロジェクト: 0xmilk/appscale
 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)
コード例 #2
0
 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)
コード例 #3
0
ファイル: flush.py プロジェクト: damonkohler/statsmonkey
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'])
コード例 #4
0
ファイル: flush.py プロジェクト: damonkohler/statsmonkey
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'])
コード例 #5
0
 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 = []
コード例 #6
0
ファイル: testcases.py プロジェクト: alatteri/informer
 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 = []