mirror of
				https://github.com/django/django.git
				synced 2025-10-30 17:16:10 +00:00 
			
		
		
		
	Whether or not the state of a test database should be serialized can be inferred from the set of databases allowed to be access from discovered TestCase/TransactionTestCase enabling the serialized_rollback feature which makes this setting unnecessary. This should make a significant test suite bootstraping time difference on large projects that didn't explicitly disable test database serialization.
		
			
				
	
	
		
			24 lines
		
	
	
		
			433 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			433 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| import unittest
 | |
| 
 | |
| 
 | |
| class NoDatabaseTests(unittest.TestCase):
 | |
|     def test_nothing(self):
 | |
|         pass
 | |
| 
 | |
| 
 | |
| class DefaultDatabaseTests(NoDatabaseTests):
 | |
|     databases = {'default'}
 | |
| 
 | |
| 
 | |
| class DefaultDatabaseSerializedTests(NoDatabaseTests):
 | |
|     databases = {'default'}
 | |
|     serialized_rollback = True
 | |
| 
 | |
| 
 | |
| class OtherDatabaseTests(NoDatabaseTests):
 | |
|     databases = {'other'}
 | |
| 
 | |
| 
 | |
| class AllDatabasesTests(NoDatabaseTests):
 | |
|     databases = '__all__'
 |