mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	fix settings override?
This commit is contained in:
		@@ -2,7 +2,7 @@
 | 
				
			|||||||
import json
 | 
					import json
 | 
				
			||||||
from test.support import EnvironmentVarGuard
 | 
					from test.support import EnvironmentVarGuard
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from django.test import TestCase
 | 
					from django.test import TestCase, override_settings
 | 
				
			||||||
import django.core.exceptions as django_exceptions
 | 
					import django.core.exceptions as django_exceptions
 | 
				
			||||||
from django.core.exceptions import ValidationError
 | 
					from django.core.exceptions import ValidationError
 | 
				
			||||||
from django.contrib.auth import get_user_model
 | 
					from django.contrib.auth import get_user_model
 | 
				
			||||||
@@ -429,11 +429,10 @@ class TestSettings(TestCase):
 | 
				
			|||||||
            settings.USER_ADDED = False
 | 
					            settings.USER_ADDED = False
 | 
				
			||||||
            registry.reload_plugins()
 | 
					            registry.reload_plugins()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @override_settings(TESTING_ENV=True)
 | 
				
			||||||
    def test_set_user_to_few(self):
 | 
					    def test_set_user_to_few(self):
 | 
				
			||||||
        # add shortcut
 | 
					        # add shortcut
 | 
				
			||||||
        user_count = self.user_mdl.objects.count
 | 
					        user_count = self.user_mdl.objects.count
 | 
				
			||||||
        # enable testing mode
 | 
					 | 
				
			||||||
        settings.TESTING_ENV = True
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # nothing set
 | 
					        # nothing set
 | 
				
			||||||
        self.assertEqual(user_count(), 0)
 | 
					        self.assertEqual(user_count(), 0)
 | 
				
			||||||
@@ -457,6 +456,3 @@ class TestSettings(TestCase):
 | 
				
			|||||||
        with self.assertRaises(IntegrationPluginError):
 | 
					        with self.assertRaises(IntegrationPluginError):
 | 
				
			||||||
            self.run_reload()
 | 
					            self.run_reload()
 | 
				
			||||||
        self.assertEqual(user_count(), 1)
 | 
					        self.assertEqual(user_count(), 1)
 | 
				
			||||||
 | 
					 | 
				
			||||||
        # make sure to clean up
 | 
					 | 
				
			||||||
        settings.TESTING_ENV = False
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user