Changes between Initial Version and Version 1 of Ticket #14296, comment 2


Ignore:
Timestamp:
Sep 9, 2015, 8:36:35 AM (9 years ago)
Author:
Tim Graham

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14296, comment 2

    initial v1  
    11A simple hack that seems to work for this is to modify the action of setup_databases in django/test/simple.py
    2 
     2{{{#!diff
    33 def setup_databases(self, **kwargs):
    44        from django.db import connections
     
    2828                connection.creation.create_test_db(self.verbosity, autoclobber=not self.interactive)
    2929        return old_names, mirrors
    30 
     30}}}
    3131and then place the names of the connections inside the variable in your settings.py:
    32 
     32{{{
    3333    RUN_TESTS_ON_LIVE_DB = ['dbname',]
    34 
     34}}}
    3535This seems to force the tests to run against the live database, write operations will simply fail due to permissions and one no longer needs complex alternative db setups.
    36 
    37 Hack..
    38 
    39 
Back to Top