Code

Ticket #6477: 0001-Make-running-unit-tests-easier.patch

File 0001-Make-running-unit-tests-easier.patch, 1.3 KB (added by Bastian Kleineidam <calvin@…>, 6 years ago)
  • new file Makefile

    From dabc45c80a07752fc9eee4abe515ecce2d7ddc81 Mon Sep 17 00:00:00 2001
    From: Bastian Kleineidam <calvin@debian.org>
    Date: Thu, 24 Jan 2008 20:27:39 +0100
    Subject: Make running unit tests easier
     Added a Makefile with "test" target and a default unittest
     settings file. This enables users to easily run unittests
     with "make test".
    
    
    Signed-off-by: Bastian Kleineidam <calvin@debian.org>
    
    diff --git a/Makefile b/Makefile
    new file mode 100644
    index 0000000..a431e52
    - +  
     1 
     2# run unit tests 
     3test: 
     4        DJANGO_SETTINGS_MODULE=settings_unittest PYTHONPATH=.:tests python tests/runtests.py -v1 
  • new file tests/settings_unittest.py

    diff --git a/tests/settings_unittest.py b/tests/settings_unittest.py
    new file mode 100644
    index 0000000..b9e1166
    - +  
     1DATABASE_ENGINE = 'sqlite3'  # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. 
     2DATABASE_NAME = ':memory:'   # Or path to database file if using sqlite3. 
     3DATABASE_USER = ''           # Not used with sqlite3. 
     4DATABASE_PASSWORD = ''       # Not used with sqlite3. 
     5DATABASE_HOST = ''           # Set to empty string for localhost. Not used with sqlite3. 
     6DATABASE_PORT = ''           # Set to empty string for default. Not used with sqlite3. 
     7ROOT_URLCONF = 'foo.urls'